summaryrefslogtreecommitdiff
path: root/plugins/git-prompt
diff options
context:
space:
mode:
authorThanh Ha <zxiiro@gmail.com>2018-07-29 11:45:35 -0400
committerMarc Cornellà <marc.cornella@live.com>2018-07-29 17:45:35 +0200
commit5fa7824ea59ec12a976f348a83399e66699456ea (patch)
tree0cbe022295c5c9a1987a429ce62b711fa865613f /plugins/git-prompt
parenta24a0b1a8e464fd4c6ab6c2f95ef5a8f025ff093 (diff)
downloadzsh-5fa7824ea59ec12a976f348a83399e66699456ea.tar.gz
zsh-5fa7824ea59ec12a976f348a83399e66699456ea.tar.bz2
zsh-5fa7824ea59ec12a976f348a83399e66699456ea.zip
git-prompt: fix error when multiple tags exist (#6998)
When a commit has multiple tags associated to it, the git-prompt will throw the following error: git_super_status:[:4: integer expression expected: v0.21.x\ntags/v0.21.5, git_super_status:[:7: integer expression expected: origin/v0.21.x, git_super_status:[:11: integer expression expected: origin/v0.21.x, git_super_status:[:14: integer expression expected: v0.21.x git_super_status:[:23: integer expression expected: v0.21.x This is due to the prompt expecting the tag field to be a single word with no spaces in between but if there are multiple tags the python script returns a string with ', ' space separated list of tags. This throws off the parser. The solution is to ensure that the python script returns a space-less string ensuring the git-prompt parser to properly parse the data. Signed-off-by: Thanh Ha <zxiiro@linux.com>
Diffstat (limited to 'plugins/git-prompt')
-rw-r--r--plugins/git-prompt/gitstatus.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index 14d875973..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