]> git.phdru.name Git - dotfiles.git/commitdiff
Fix(bash_prompt): Get upstream using old version of `git`
authorOleg Broytman <phd@phdru.name>
Mon, 14 Dec 2020 21:14:35 +0000 (00:14 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 18 Dec 2020 16:01:58 +0000 (19:01 +0300)
admin/prog/bash_prompt

index 4e428f398450283bf5d72833cab7e453e776e420..aedf458e7b192eb600b5774c0d843fefb1e1cc9b 100644 (file)
@@ -70,9 +70,9 @@ prompt_git() {
                       printf "(unknown)")"
 
         up=`git rev-parse --abbrev-ref @{u} 2>/dev/null`
-        if [ -n "$up" ]; then
+        if [ -n "$up" -a "$up" != "@{u}" ]; then
             local left right
-            set -- `git rev-list --count --left-right @{u}...@`
+            set -- `git rev-list --count --left-right @{u}...HEAD`
             left=$1
             right=$2
             if [ "$left" -gt 0 -o "$right" -gt 0 ]; then