Skip to content

Commit

Permalink
Rename _run_command
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed Nov 23, 2023
1 parent f92a9ed commit 9c26695
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions saritasa_invocations/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ def blame_copy(
)

# temp file to save original file
temp_file = _run_command(
temp_file = _get_command_output(
context=context,
command=f"mktemp ./{destination_paths_list[0]}.XXXXXX",
)

# current HEAD state
printing.print_success("Get current HEAD sha")
root_commit = _run_command(
root_commit = _get_command_output(
context=context,
command="git rev-parse HEAD",
)
Expand Down Expand Up @@ -235,7 +235,7 @@ def _copy_files(
action=f"create {path}",
)
context.run(f"git commit --no-verify -n -m '{commit_message}'")
new_commit = _run_command(
new_commit = _get_command_output(
context=context,
command="git rev-parse HEAD",
)
Expand Down Expand Up @@ -266,7 +266,7 @@ def _get_jira_task_from_current_branch(
If branch has no task, then empty string will return.
"""
current_branch = _run_command(
current_branch = _get_command_output(
context=context,
command="git branch --show-current",
)
Expand All @@ -277,11 +277,11 @@ def _get_jira_task_from_current_branch(
return task


def _run_command(
def _get_command_output(
context: invoke.Context,
command: str,
) -> str:
"""Run command.
"""Get command output.
Try to run command using context.
If no result returned then cancel command execution.
Expand Down

0 comments on commit 9c26695

Please sign in to comment.