summaryrefslogtreecommitdiffstats
path: root/prompt
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2026-03-08 18:52:47 -0400
committerMatt Hunter <m@lfurio.us>2026-03-30 21:56:09 -0400
commit4f88708af94e82e7f8da427d7f3c6a876acbd71a (patch)
tree362ad0338b3e544dfcf8c5af4c2dc35b9c695cc1 /prompt
parent23b39889be1b58f17c945b54b6d180778a0f86ed (diff)
downloadgit-sonar-4f88708af94e82e7f8da427d7f3c6a876acbd71a.tar.gz
git-sonar-4f88708af94e82e7f8da427d7f3c6a876acbd71a.zip
Fix a bug which surfaced in commits_ahead/behind_remoteHEADmaster
If a remote branch is set, but doesn't exist (in the 'missingups' condition), these functions would output blank ("") causing an error when used in comparisons in color_local_commits(). It's arguable whether the POSIX reworks caused this bug or simply revealed it, since the previous code used bash's [[ ]] test syntax which seemed to tolerate this case. Restructure control flow so that any "error" in these functions yields a result of "0". The ahead/behind_master functions did not have this problem (the git-rev-list command failure is already handled), but rewrite them to match the style of the local functions. Additionally, the git-rev-list commands are updated to use the more straight-forward A..B syntax, dropping the use of --left-only or --right-only. This is more obvious code, and older git clients may return incorrect results using the previous syntax. Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions