From: Patrick Steinhardt Date: Fri, 14 Apr 2023 06:01:59 +0000 (+0200) Subject: pack-objects: extend test coverage of `--stdin-packs` with alternates X-Git-Tag: v2.41.0-rc0~58^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3028418c3b68350aa810064c95283062c9157d6;p=thirdparty%2Fgit.git pack-objects: extend test coverage of `--stdin-packs` with alternates We don't have any tests that verify that git-pack-objects(1) works with `--stdin-packs` when combined with alternate object directories. Add some to make sure that the basic functionality works as expected. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- diff --git a/t/t5331-pack-objects-stdin.sh b/t/t5331-pack-objects-stdin.sh index 3ef736ec05..acab31667a 100755 --- a/t/t5331-pack-objects-stdin.sh +++ b/t/t5331-pack-objects-stdin.sh @@ -189,4 +189,52 @@ test_expect_success 'pack-objects --stdin with same packfile excluded and includ ) ' +test_expect_success 'pack-objects --stdin with packfiles from alternate object database' ' + test_when_finished "rm -fr shared member" && + + # Set up a shared repository with a single packfile. + git init shared && + test_commit -C shared "shared-objects" && + git -C shared repack -ad && + basename shared/.git/objects/pack/pack-*.pack >packfile && + + # Set up a repository that is connected to the shared repository. This + # repository has no objects on its own, but we still expect to be able + # to pack objects from its alternate. + git clone --shared shared member && + git -C member pack-objects --stdin-packs generated-pack packfiles && + + { + packed_objects shared/.git/objects/pack/pack-*.idx && + packed_objects member/.git/objects/pack/pack-*.idx + } | sort >expected-objects && + + git -C member pack-objects --stdin-packs generated-pack actual-objects && + test_cmp expected-objects actual-objects +' + test_done