mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
Fix ahead printing when both ahead and behind
Specifically, the awk parsing bails out early if we're ahead, even though there may be later behind commits, resulting in a status of just "+" when "±" would be correct.
This commit is contained in:
parent
ea9467fbff
commit
489a2eee3d
@ -127,7 +127,7 @@ function __bobthefish_git_ahead -d 'Print the ahead/behind state for the current
|
||||
return
|
||||
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
|
||||
|
||||
function __bobthefish_git_ahead_verbose -d 'Print a more verbose ahead/behind state for the current branch'
|
||||
|
Loading…
Reference in New Issue
Block a user