diff options
Diffstat (limited to '')
| -rwxr-xr-x | bin/vcs | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -88,6 +88,16 @@ git_ps1() { IS_BEHIND=true fi + HAS_UPSTREAM=false + if printf '%s\n' "$BRANCH_LINE" | grep -qF '...'; then + HAS_UPSTREAM=true + fi + + HAS_ORIGIN=false + if [ -n "$(git config --local --get remote.origin.url 2>/dev/null)" ]; then + HAS_ORIGIN=true + fi + LINE='' if [ "$IS_AHEAD" = true ] && [ "$IS_BEHIND" = true ]; then @@ -118,6 +128,13 @@ git_ps1() { elif [ "$HAS_UNTRACKED" = true ]; then COLOR_FN=lightblue LINE="{$LINE}" + elif [ "$HAS_UPSTREAM" = false ]; then + if [ "$HAS_ORIGIN" = true ]; then + COLOR_FN=yellow + else + COLOR_FN=yellowb + fi + LINE="($LINE)" else COLOR_FN=green LINE="($LINE)" |
