Merge pull request #3 from tchajed/fix-ahead-behind

Fix ahead printing when both ahead and behind
This commit is contained in:
Justin Hileman 2015-06-26 10:41:09 -07:00
commit 2c915008cd

View File

@ -127,7 +127,7 @@ function __bobthefish_git_ahead -d 'Print the ahead/behind state for the current
return return
end end
command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null | awk '/>/ {a += 1} /</ {b += 1} {if (a > 0) nextfile} END {if (a > 0 && b > 0) print "±"; else if (a > 0) print "+"; else if (b > 0) print "-"}' command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null | awk '/>/ {a += 1} /</ {b += 1} {if (a > 0 && b > 0) nextfile} END {if (a > 0 && b > 0) print "±"; else if (a > 0) print "+"; else if (b > 0) print "-"}'
end end
function __bobthefish_git_ahead_verbose -d 'Print a more verbose ahead/behind state for the current branch' function __bobthefish_git_ahead_verbose -d 'Print a more verbose ahead/behind state for the current branch'