diff options
author | khenarghot <khenarghot@users.noreply.github.com> | 2016-08-21 20:40:34 +0400 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2016-08-21 18:40:34 +0200 |
commit | 292a62e3abf1bc0e87c3e1ff0012ebf6e03eb241 (patch) | |
tree | 310bf0e33f23712fc6970def0c8ff3681164735d /themes | |
parent | 774c4eca6f166be554baf33ff48de9e90e98f16a (diff) | |
download | zsh-292a62e3abf1bc0e87c3e1ff0012ebf6e03eb241.tar.gz zsh-292a62e3abf1bc0e87c3e1ff0012ebf6e03eb241.tar.bz2 zsh-292a62e3abf1bc0e87c3e1ff0012ebf6e03eb241.zip |
Fix git emptiness check in dogenpunk theme (#5329)
The parsing output for full git log output too slow so it replaced
with last commit show request, wich cause error if repository is empty
Diffstat (limited to 'themes')
-rw-r--r-- | themes/dogenpunk.zsh-theme | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme index d6719281d..6a9921288 100644 --- a/themes/dogenpunk.zsh-theme +++ b/themes/dogenpunk.zsh-theme @@ -37,7 +37,7 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" function git_time_since_commit() { if git rev-parse --git-dir > /dev/null 2>&1; then # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + if git log -n 1 > /dev/null 2>&1; then # Get the last commit. last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` now=`date +%s` |