status: support --no-ahead-behind in long format

Teach long (normal) status format to respect the --no-ahead-behind
parameter and skip the possibly expensive ahead/behind computation
between the branch and the upstream.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff Hostetler
2018-01-09 18:50:18 +00:00
committed by Junio C Hamano
parent 3ca1897cc1
commit f39a757dd9
5 changed files with 46 additions and 8 deletions

View File

@ -610,7 +610,7 @@ static void report_tracking(struct branch_info *new)
struct strbuf sb = STRBUF_INIT;
struct branch *branch = branch_get(new->name);
if (!format_tracking_info(branch, &sb))
if (!format_tracking_info(branch, &sb, AHEAD_BEHIND_FULL))
return;
fputs(sb.buf, stdout);
strbuf_release(&sb);