summaryrefslogtreecommitdiff
path: root/plugins/git-prompt/gitstatus.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/git-prompt/gitstatus.py')
-rw-r--r--plugins/git-prompt/gitstatus.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index a8eb8284b..a4d07cde6 100644
--- a/plugins/git-prompt/gitstatus.py
+++ b/plugins/git-prompt/gitstatus.py
@@ -22,7 +22,7 @@ def get_tagname_or_hash():
tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1]
if tagname:
- return tagname
+ return tagname.replace(' ', '')
elif hash_:
return hash_
return None
@@ -41,7 +41,7 @@ ahead, behind = 0, 0
status = [(line[0], line[1], line[2:]) for line in stdout.decode('utf-8').splitlines()]
for st in status:
if st[0] == '#' and st[1] == '#':
- if re.search('Initial commit on', st[2]):
+ if re.search('Initial commit on', st[2]) or re.search('No commits yet on', st[2]):
branch = st[2].split(' ')[-1]
elif re.search('no branch', st[2]): # detached status
branch = get_tagname_or_hash()