diff options
Diffstat (limited to 'plugins/git-prompt')
-rw-r--r-- | plugins/git-prompt/README.md | 3 | ||||
-rw-r--r-- | plugins/git-prompt/gitstatus.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md index e3b2d623a..83948f536 100644 --- a/plugins/git-prompt/README.md +++ b/plugins/git-prompt/README.md @@ -11,6 +11,9 @@ plugins=(... git-prompt) See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). +## Prerequisites +This plugin uses `python`, so your host needs to have it installed + ## Examples The prompt may look like the following: diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 300365d71..bf3173614 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -11,11 +11,11 @@ def get_tagname_or_hash(): """return tagname if exists else hash""" # get hash hash_cmd = ['git', 'rev-parse', '--short', 'HEAD'] - hash_ = check_output(hash_cmd).strip() + hash_ = check_output(hash_cmd).decode('utf-8').strip() # get tagname tags_cmd = ['git', 'for-each-ref', '--points-at=HEAD', '--count=2', '--sort=-version:refname', '--format=%(refname:short)', 'refs/tags'] - tags = check_output(tags_cmd).split() + tags = check_output(tags_cmd).decode('utf-8').split() if tags: return tags[0] + ('+' if len(tags) > 1 else '') |