Skip to content

Commit

Permalink
fix bug where errors are displayed in stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierverdier committed Aug 21, 2011
1 parent c074a76 commit 7f5e454
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from subprocess import Popen, PIPE

gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE,)
gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE)
branch = gitsym.communicate()[0]

if gitsym.returncode != 0:
Expand Down Expand Up @@ -43,10 +43,10 @@
remote_ref = merge_name
else:
remote_ref = 'refs/remotes/%s/%s' % (remote_name, merge_name[11:])
revgit = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % remote_ref],stdout=PIPE,)
revgit = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % remote_ref],stdout=PIPE, stderr=PIPE)
revlist = revgit.communicate()[0]
if revgit.returncode != 0: # fallback to local
revlist = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % merge_name],stdout=PIPE,).communicate()[0]
revlist = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % merge_name],stdout=PIPE, stderr=PIPE).communicate()[0]
behead = revlist.splitlines()
ahead = len([x for x in behead if x[0]=='>'])
behind = len(behead) - ahead
Expand Down

0 comments on commit 7f5e454

Please sign in to comment.