summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2018-01-09 18:50:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-24 21:48:38 (GMT)
commitfd9b544a2991ad74d73ad1bc0af4d24f91a6802b (patch)
tree175285017f510542e6bf558d94d025518bd3dd5d /remote.c
parentd7d1b496aeea5a151c826683ed28c57ef0ac9389 (diff)
downloadgit-fd9b544a2991ad74d73ad1bc0af4d24f91a6802b.zip
git-fd9b544a2991ad74d73ad1bc0af4d24f91a6802b.tar.gz
git-fd9b544a2991ad74d73ad1bc0af4d24f91a6802b.tar.bz2
status: add --[no-]ahead-behind to status and commit for V2 format.
Teach "git status" and "git commit" to accept "--no-ahead-behind" and "--ahead-behind" arguments to request quick or full ahead/behind reporting. When "--no-ahead-behind" is given, the existing porcelain V2 line "branch.ab +x -y" is replaced with a new "branch.ab +? -?" line. This indicates that the branch and its upstream are or are not equal without the expense of computing the full ahead/behind values. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index 29d47a5..e514536 100644
--- a/remote.c
+++ b/remote.c
@@ -2058,6 +2058,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
return 0;
if (abf == AHEAD_BEHIND_QUICK)
return 1;
+ if (abf != AHEAD_BEHIND_FULL)
+ BUG("stat_tracking_info: invalid abf '%d'", abf);
/* Run "rev-list --left-right ours...theirs" internally... */
argv_array_push(&argv, ""); /* ignored */