From 4fa4f96c662488ebf498859c6f014f6fb969ff1c Mon Sep 17 00:00:00 2001 From: "Egorov N.V" Date: Sun, 21 Aug 2016 11:35:06 +0300 Subject: [PATCH] Simplify git empty repo check Exclude text string check. Only log run Ok. --- themes/dogenpunk.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme index a964c101a..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 -n 1 2>&1 > /dev/null | grep -Ec "^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`