05b3ea342ad581d02ed652a4bbe29786026a5b50

Author
Steven Schmid <stevschmid@gmail.com>
Committer
Steven Schmid <stevschmid@gmail.com>
Date

Message

Fix work_in_progress in empty git repos

I noticed that the function ``work_in_progress``, which is used in the "gallois"-theme, would print ``fatal: bad default revision 'HEAD'`` in a new folder after ``git init``.

This is the fix.

Diff

 1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 2index d8ea3ae0c3278d8e472502d64fbc566a8973b1c3..14172b881d40c342e11d5e300d9b741f191232ab 100644
 3--- a/plugins/git/git.plugin.zsh
 4+++ b/plugins/git/git.plugin.zsh
 5@@ -138,7 +138,7 @@ compdef _git glp=git-log
 6 #
 7 # This function return a warning if the current branch is a wip
 8 function work_in_progress() {
 9-  if $(git log -n 1 | grep -q -c wip); then
10+  if $(git log -n 1 2>/dev/null | grep -q -c wip); then
11     echo "WIP!!"
12   fi
13 }