summaryrefslogtreecommitdiffstats
path: root/t/t5317-pack-objects-filter-objects.sh
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2023-10-02 18:54:56 +0200
committerJunio C Hamano <gitster@pobox.com>2023-10-02 23:54:29 +0200
commit6cfcabfb9f60369f6fb4d24465a7c98b1d90b34b (patch)
treefebef9eddbc4d5b407b3a5e66c20917ba7962eba /t/t5317-pack-objects-filter-objects.sh
parentThe twelfth batch (diff)
downloadgit-6cfcabfb9f60369f6fb4d24465a7c98b1d90b34b.tar.xz
git-6cfcabfb9f60369f6fb4d24465a7c98b1d90b34b.zip
pack-objects: allow `--filter` without `--stdout`
9535ce7337 (pack-objects: add list-objects filtering, 2017-11-21) taught `git pack-objects` to use `--filter`, but required the use of `--stdout` since a partial clone mechanism was not yet in place to handle missing objects. Since then, changes like 9e27beaa23 (promisor-remote: implement promisor_remote_get_direct(), 2019-06-25) and others added support to dynamically fetch objects that were missing. Even without a promisor remote, filtering out objects can also be useful if we can put the filtered out objects in a separate pack, and in this case it also makes sense for pack-objects to write the packfile directly to an actual file rather than on stdout. Remove the `--stdout` requirement when using `--filter`, so that in a follow-up commit, repack can pass `--filter` to pack-objects to omit certain objects from the resulting packfile. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5317-pack-objects-filter-objects.sh')
-rwxr-xr-xt/t5317-pack-objects-filter-objects.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index b26d476c64..2ff3eef9a3 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -53,6 +53,14 @@ test_expect_success 'verify blob:none packfile has no blobs' '
! grep blob verify_result
'
+test_expect_success 'verify blob:none packfile without --stdout' '
+ git -C r1 pack-objects --revs --filter=blob:none mypackname >packhash <<-EOF &&
+ HEAD
+ EOF
+ git -C r1 verify-pack -v "mypackname-$(cat packhash).pack" >verify_result &&
+ ! grep blob verify_result
+'
+
test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '
git -C r1 verify-pack -v ../all.pack >verify_result &&
grep -E "commit|tree" verify_result |