Просмотр исходного кода

Silence warning in git prompt

Without this, git wip indicator function was returning a grep warning of
"stray \ before -". Use the `-e` option since, as the manpage tells, it
is to be used "to protect a pattern beginning with a hyphen (-)".
Weiyi Lou 1 год назад
Родитель
Сommit
ab3585f7a8
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      shell/common/git-prompt.sh

+ 1 - 1
shell/common/git-prompt.sh

@@ -155,7 +155,7 @@ function __gitp_wips() {
   local stash=${GITP_STASH:-"$cRed STASH"}
   local wips
 
-  if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
+  if $(git log --oneline -n 1 2>/dev/null | grep -q -c -e --wip--); then
     wips="$wip"
   fi