mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
Cleanup the rest of gitstatus.py
This commit is contained in:
parent
5642014ff1
commit
1d133ff11f
1 changed files with 3 additions and 6 deletions
|
@ -4,16 +4,13 @@ from __future__ import print_function
|
||||||
# change this symbol to whatever you prefer
|
# change this symbol to whatever you prefer
|
||||||
prehash = ':'
|
prehash = ':'
|
||||||
|
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
import sys
|
branch, error = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE).communicate()
|
||||||
gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE)
|
|
||||||
branch, error = gitsym.communicate()
|
|
||||||
|
|
||||||
error_string = error.decode('utf-8')
|
if 'fatal: Not a git repository' in error.decode('utf-8'):
|
||||||
|
|
||||||
if 'fatal: Not a git repository' in error_string:
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
branch = branch.decode("utf-8").strip()[11:]
|
branch = branch.decode("utf-8").strip()[11:]
|
||||||
|
|
Loading…
Reference in a new issue