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 ee37666
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PyGitUp/git_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ 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[0] if std_outs else None)

return std_outs[0].strip() if std_outs else bytes()

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

0 comments on commit ee37666

Please sign in to comment.