Skip to content

Commit b48015b

Browse files
avargitster
authored andcommitted
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 c685450 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eddc1f5 commit b48015b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t3800-mktag.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ check_verify_failure () {
7878
# will always fail.
7979
test_must_fail git -C bad-tag fsck
8080
'
81+
82+
test_expect_success "for-each-ref: $subject" '
83+
# Make sure the earlier test created it for us
84+
git rev-parse "$bad_tag" &&
85+
86+
echo "$bad_tag" >"bad-tag/$tag_ref" &&
87+
88+
printf "%s tag\t%s\n" "$bad_tag" "$tag_ref" >expected &&
89+
git -C bad-tag for-each-ref "$tag_ref" >actual &&
90+
test_cmp expected actual &&
91+
92+
test_must_fail git -C bad-tag for-each-ref --format="%(*objectname)"
93+
'
8194
}
8295

8396
test_expect_mktag_success() {

0 commit comments

Comments
 (0)