Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
1d133ff1
Commit
1d133ff1
authored
Aug 01, 2015
by
Marc Cornellà
Browse files
Cleanup the rest of gitstatus.py
parent
5642014f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/git-prompt/gitstatus.py
View file @
1d133ff1
...
@@ -4,16 +4,13 @@ from __future__ import print_function
...
@@ -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
_string
:
if
'fatal: Not a git repository'
in
error
.
decode
(
'utf-8'
)
:
sys
.
exit
(
0
)
sys
.
exit
(
0
)
branch
=
branch
.
decode
(
"utf-8"
).
strip
()[
11
:]
branch
=
branch
.
decode
(
"utf-8"
).
strip
()[
11
:]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment