Skip to content

Commit

Permalink
cherry-pick: tighten up output
Browse files Browse the repository at this point in the history
If stdout or stderr are empty, don't print empty lines.
Also trim any trailing lines so we don't show excess ones.

Change-Id: I65fcea191e1f725be03c064cb510578632466013
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343516
Tested-by: Mike Frysinger <[email protected]>
Reviewed-by: LaMont Jones <[email protected]>
  • Loading branch information
vapier committed Aug 22, 2022
1 parent 63a5657 commit 8a54a7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subcmds/cherry_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ def Execute(self, opt, args):
capture_stderr=True)
status = p.Wait()

print(p.stdout, file=sys.stdout)
print(p.stderr, file=sys.stderr)
if p.stdout:
print(p.stdout.strip(), file=sys.stdout)
if p.stderr:
print(p.stderr.strip(), file=sys.stderr)

if status == 0:
# The cherry-pick was applied correctly. We just need to edit the
Expand Down

0 comments on commit 8a54a7e

Please sign in to comment.