Message ID | 64613ad7ad6e5224c9d36fd1fd6222cbd3538705.1592350413.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Sparse checkout status | expand |
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index 014cd7c3cfc..3e7344a4014 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -421,6 +421,11 @@ __git_ps1 () return $exit fi + local sparse="" + if [ "$(git config --bool core.sparseCheckout)" == "true" ]; then + sparse="|SPARSE" + fi + local r="" local b="" local step="" @@ -543,7 +548,7 @@ __git_ps1 () fi local f="$w$i$s$u" - local gitstring="$c$b${f:+$z$f}$r$p" + local gitstring="$c$b${f:+$z$f}${sparse}$r$p" if [ $pcmode = yes ]; then if [ "${__git_printf_supports_v-}" != yes ]; then