diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2018-01-09 18:50:18 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-24 13:48:39 -0800 |
commit | f39a757dd93488103dde76e992a75edf2d772b62 (patch) | |
tree | d27d738996d848c0d0e2bababaf4435040fc34f0 /t | |
parent | status: update short status to respect --no-ahead-behind (diff) | |
download | tgif-f39a757dd93488103dde76e992a75edf2d772b62.tar.xz |
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>
Diffstat (limited to 't')
-rwxr-xr-x | t/t6040-tracking-info.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh index 019022080b..716283b274 100755 --- a/t/t6040-tracking-info.sh +++ b/t/t6040-tracking-info.sh @@ -160,6 +160,35 @@ test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' ' ' cat >expect <<\EOF +On branch b1 +Your branch and 'origin/master' have diverged, +and have 1 and 1 different commits each, respectively. +EOF + +test_expect_success 'status --long --branch' ' + ( + cd test && + git checkout b1 >/dev/null && + git status --long -b | head -3 + ) >actual && + test_i18ncmp expect actual +' + +cat >expect <<\EOF +On branch b1 +Your branch and 'origin/master' refer to different commits. +EOF + +test_expect_success 'status --long --branch --no-ahead-behind' ' + ( + cd test && + git checkout b1 >/dev/null && + git status --long -b --no-ahead-behind | head -2 + ) >actual && + test_i18ncmp expect actual +' + +cat >expect <<\EOF ## b5...brokenbase [gone] EOF |