Skip to content

Commit

Permalink
Fix git emptiness check in dogenpunk theme (#5329)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
khenarghot authored and mcornella committed Aug 21, 2016
1 parent 774c4ec commit 292a62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion themes/dogenpunk.zsh-theme
Expand Up @@ -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`
Expand Down

0 comments on commit 292a62e

Please sign in to comment.