[PATCH v2 5/6] mktag tests: test for-each-ref
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jun 17, 2021, 10:42 UTC
- Message-ID
- <patch-5.6-f4c41be92d-20210617T104011Z-avarab@gmail.com>
- In-Reply-To
- <cover-0.6-0000000000-20210617T104011Z-avarab@gmail.com>
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> --- t/t3800-mktag.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+)
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() {
-- 2.32.0.571.gdba276db2c