Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-06-17 13:42:01 +0300
committerJunio C Hamano <gitster@pobox.com>2021-06-28 19:30:41 +0300
commitb48015b3404cb19bfd3b6df1a372164d8cd3f7d7 (patch)
treefc5fb60baf1f4cfb11de46d4c1ad11370c69771e /t/t3800-mktag.sh
parenteddc1f556cd031d59b044ab655cdc591c6180e21 (diff)
mktag tests: test for-each-ref
Add a "for-each-ref" for all the mktag tests. This test would have caught the segfault which was fixed in c6854508808 (ref-filter: fix NULL check for parse object failure, 2021-04-01). Let's make sure we test that code more exhaustively. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3800-mktag.sh')
-rwxr-xr-xt/t3800-mktag.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh
index 67f6ecbe88..bb71303399 100755
--- a/t/t3800-mktag.sh
+++ b/t/t3800-mktag.sh
@@ -78,6 +78,19 @@ check_verify_failure () {
# will always fail.
test_must_fail git -C bad-tag fsck
'
+
+ test_expect_success "for-each-ref: $subject" '
+ # Make sure the earlier test created it for us
+ git rev-parse "$bad_tag" &&
+
+ echo "$bad_tag" >"bad-tag/$tag_ref" &&
+
+ printf "%s tag\t%s\n" "$bad_tag" "$tag_ref" >expected &&
+ git -C bad-tag for-each-ref "$tag_ref" >actual &&
+ test_cmp expected actual &&
+
+ test_must_fail git -C bad-tag for-each-ref --format="%(*objectname)"
+ '
}
test_expect_mktag_success() {