Skip to content

Commit 860ae5c

Browse files
committed
Improve error output when git commit fails
1 parent 70a565f commit 860ae5c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cherry_picker/cherry_picker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ def run_cmd(self, cmd, required_real_result=False):
233233
if not required_real_result and self.dry_run:
234234
click.echo(f" dry-run: {' '.join(cmd)}")
235235
return
236-
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
236+
try:
237+
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
238+
except subprocess.CalledProcessError as exc:
239+
click.echo(exc.output.decode("utf-8"))
240+
raise
237241
return output.decode("utf-8")
238242

239243
def checkout_branch(self, branch_name, *, create_branch=False):

0 commit comments

Comments
 (0)