Skip to content

Commit

Permalink
fix: make run_cmd more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
msiemens committed Oct 5, 2024
1 parent 1bd0f00 commit b523006
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PyGitUp/git_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ def run_cmd(cmd: GitCmd.AutoInterrupt) -> bytes:
error.status
)

raise GitError(message, stderr=error.stderr, stdout=std_outs[0])
return std_outs[0].strip()
raise GitError(message, stderr=error.stderr, stdout=std_outs.pop())

std_out = std_outs.pop()
return std_out.strip() if std_out is not None else bytes()

def config(self, key):
""" Return `git config key` output or None. """
Expand Down

0 comments on commit b523006

Please sign in to comment.