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 c685450880
(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>
This commit is contained in:
parent
eddc1f556c
commit
b48015b340
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user