summaryrefslogtreecommitdiff
path: root/t/t6040-tracking-info.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:24 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:24 -0800
commit4094e47fd2c49fcdbd0152d20ed4d610d72680d7 (patch)
tree6f444715c2f37cf75953f4df436b6adda1483357 /t/t6040-tracking-info.sh
parentMerge branch 'sg/travis-build-during-script-phase' (diff)
parentstatus: support --no-ahead-behind in long format (diff)
downloadtgif-4094e47fd2c49fcdbd0152d20ed4d610d72680d7.tar.xz
Merge branch 'jh/status-no-ahead-behind'
"git status" can spend a lot of cycles to compute the relation between the current branch and its upstream, which can now be disabled with "--no-ahead-behind" option. * jh/status-no-ahead-behind: status: support --no-ahead-behind in long format status: update short status to respect --no-ahead-behind status: add --[no-]ahead-behind to status and commit for V2 format. stat_tracking_info: return +1 when branches not equal
Diffstat (limited to 't/t6040-tracking-info.sh')
-rwxr-xr-xt/t6040-tracking-info.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 8f17fd9da8..716283b274 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -147,6 +147,48 @@ test_expect_success 'status -s -b (diverged from upstream)' '
'
cat >expect <<\EOF
+## b1...origin/master [different]
+EOF
+
+test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
+ (
+ cd test &&
+ git checkout b1 >/dev/null &&
+ git status -s -b --no-ahead-behind | head -1
+ ) >actual &&
+ test_i18ncmp expect actual
+'
+
+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