diff options
author | Marc Cornellà <marc.cornella@live.com> | 2015-08-01 18:26:18 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2015-08-16 23:02:13 +0200 |
commit | 1d133ff11fe187ee7255637d51165013b4e6a738 (patch) | |
tree | f2362a37f39d61050cac0a992a8ff64fcfa1f920 | |
parent | 5642014ff1b718df04d803b7b0457b9872b2b4f2 (diff) | |
download | zsh-1d133ff11fe187ee7255637d51165013b4e6a738.tar.gz zsh-1d133ff11fe187ee7255637d51165013b4e6a738.tar.bz2 zsh-1d133ff11fe187ee7255637d51165013b4e6a738.zip |
Cleanup the rest of gitstatus.py
-rw-r--r-- | plugins/git-prompt/gitstatus.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 1065b3cb5..903ad474d 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -4,16 +4,13 @@ from __future__ import print_function # change this symbol to whatever you prefer prehash = ':' +import sys import subprocess from subprocess import Popen, PIPE -import sys -gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE) -branch, error = gitsym.communicate() - -error_string = error.decode('utf-8') +branch, error = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE).communicate() -if 'fatal: Not a git repository' in error_string: +if 'fatal: Not a git repository' in error.decode('utf-8'): sys.exit(0) branch = branch.decode("utf-8").strip()[11:] |