From 037de004c68d704abf839eebe075c58c9603f8f3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 20 May 2024 07:14:36 +0200 Subject: Adding upstream version 1:2.45.1. Signed-off-by: Daniel Baumann --- t/t5300-pack-object.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 't/t5300-pack-object.sh') diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index d402ec1..61e2be2 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -441,6 +441,47 @@ test_expect_success 'index-pack with --strict' ' ) ' +test_expect_success 'setup for --strict and --fsck-objects downgrading fsck msgs' ' + git init strict && + ( + cd strict && + test_commit first hello && + cat >commit <<-EOF && + tree $(git rev-parse HEAD^{tree}) + parent $(git rev-parse HEAD) + author A U Thor + committer A U Thor + + commit: this is a commit with bad emails + + EOF + git hash-object --literally -t commit -w --stdin commit_list && + git pack-objects test pack-name + ) +' + +test_with_bad_commit () { + must_fail_arg="$1" && + must_pass_arg="$2" && + ( + cd strict && + test_must_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack" && + git index-pack "$must_pass_arg" "test-$(cat pack-name).pack" + ) +} + +test_expect_success 'index-pack with --strict downgrading fsck msgs' ' + test_with_bad_commit --strict --strict="missingEmail=ignore" +' + +test_expect_success 'index-pack with --fsck-objects downgrading fsck msgs' ' + test_with_bad_commit --fsck-objects --fsck-objects="missingEmail=ignore" +' + +test_expect_success 'cleanup for --strict and --fsck-objects downgrading fsck msgs' ' + rm -rf strict +' + test_expect_success 'honor pack.packSizeLimit' ' git config pack.packSizeLimit 3m && packname_10=$(git pack-objects test-10