e2838f75f0be001cf34da321c9c712d48699e518
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #2396 from soluwalana/master
Fix WIP false positive
Diff
1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
2index fde22a37db7af1ba1688fa874242f183c7d9ff61..1285a32476b763b64d98a29b79a5388bf50fa8cf 100644
3--- a/plugins/git/git.plugin.zsh
4+++ b/plugins/git/git.plugin.zsh
5@@ -142,13 +142,13 @@ 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 2>/dev/null | 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 }
14 # these alias commit and uncomit wip branches
15-alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"'
16-alias gunwip='git log -n 1 | grep -q -c wip && git reset HEAD~1'
17+alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "--wip--"'
18+alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
19
20 # these alias ignore changes to file
21 alias gignore='git update-index --assume-unchanged'