aboutsummaryrefslogtreecommitdiffstats
path: root/t/t6301-for-each-ref-errors.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-06 13:38:21 -0700
committerJunio C Hamano <gitster@pobox.com>2023-04-06 13:38:21 -0700
commit7727da99dfab82148c5b77eaf334b305fb835956 (patch)
tree99ea4038ce40c89d09592a94a715b642160216a8 /t/t6301-for-each-ref-errors.sh
parentThe seventh batch (diff)
parentcommit-reach: add tips_reachable_from_bases() (diff)
downloadgit-7727da99dfab82148c5b77eaf334b305fb835956.tar.gz
git-7727da99dfab82148c5b77eaf334b305fb835956.zip
Merge branch 'ds/ahead-behind'
"git for-each-ref" learns '%(ahead-behind:<base>)' that computes the distances from a single reference point in the history with bunch of commits in bulk. * ds/ahead-behind: commit-reach: add tips_reachable_from_bases() for-each-ref: add ahead-behind format atom commit-reach: implement ahead_behind() logic commit-graph: introduce `ensure_generations_valid()` commit-graph: return generation from memory commit-graph: simplify compute_generation_numbers() commit-graph: refactor compute_topological_levels() for-each-ref: explicitly test no matches for-each-ref: add --stdin option
Diffstat (limited to 't/t6301-for-each-ref-errors.sh')
-rwxr-xr-xt/t6301-for-each-ref-errors.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh
index bfda1f46ad..2667dd13fe 100755
--- a/t/t6301-for-each-ref-errors.sh
+++ b/t/t6301-for-each-ref-errors.sh
@@ -54,4 +54,18 @@ test_expect_success 'Missing objects are reported correctly' '
test_must_be_empty brief-err
'
+test_expect_success 'ahead-behind requires an argument' '
+ test_must_fail git for-each-ref \
+ --format="%(ahead-behind)" 2>err &&
+ echo "fatal: expected format: %(ahead-behind:<committish>)" >expect &&
+ test_cmp expect err
+'
+
+test_expect_success 'missing ahead-behind base' '
+ test_must_fail git for-each-ref \
+ --format="%(ahead-behind:refs/heads/missing)" 2>err &&
+ echo "fatal: failed to find '\''refs/heads/missing'\''" >expect &&
+ test_cmp expect err
+'
+
test_done