aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/vcs17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/vcs b/bin/vcs
index f633f5a9..a57c9f2f 100755
--- a/bin/vcs
+++ b/bin/vcs
@@ -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)"