Minor reformatting

master
oGre 10 years ago
parent 1170818d04
commit 55becdb193
  1. 10
      gitstatus.py

@ -52,7 +52,7 @@ def get_tag_or_hash():
cmd = Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout=PIPE, stderr=PIPE) cmd = Popen(['git', 'rev-parse', '--short', 'HEAD'], stdout=PIPE, stderr=PIPE)
so, se = cmd.communicate() so, se = cmd.communicate()
hash_name = '%s' % so.decode('utf-8').strip() hash_name = '%s' % so.decode('utf-8').strip()
return symbols['prehash'] + hash_name return ''.join([symbols['prehash'], hash_name])
def get_stash(): def get_stash():
@ -69,8 +69,7 @@ def get_stash():
# `git status --porcelain --branch` can collect all information # `git status --porcelain --branch` can collect all information
# branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind
po = Popen(['git', 'status', '--porcelain', '--branch'], env={'LC_ALL': 'C'}, po = Popen(['git', 'status', '--porcelain', '--branch'], env={'LC_ALL': 'C'}, stdout=PIPE, stderr=PIPE)
stdout=PIPE, stderr=PIPE)
stdout, stderr = po.communicate() stdout, stderr = po.communicate()
if po.returncode != 0: if po.returncode != 0:
sys.exit(0) # Not a git repository sys.exit(0) # Not a git repository
@ -107,10 +106,7 @@ for st in status:
elif 'behind' in div: elif 'behind' in div:
num_behind = int(div[len('behind '):].strip()) num_behind = int(div[len('behind '):].strip())
behind = '%s%s' % (symbols['behind'], num_behind) behind = '%s%s' % (symbols['behind'], num_behind)
remote = ''.join([ remote = ''.join([behind, ahead])
behind,
ahead
])
elif st[0] == '?' and st[1] == '?': elif st[0] == '?' and st[1] == '?':
untracked.append(st) untracked.append(st)
else: else:

Loading…
Cancel
Save