]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/cat-file: support "blob:none" objects filter
authorPatrick Steinhardt <ps@pks.im>
Wed, 2 Apr 2025 11:13:39 +0000 (13:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:43:50 +0000 (14:43 -0700)
commit3794e9bf982cde754a48b569a639bd2e180e754c
tree8e034bbe0ba3ba151c467082441b5b6421f63f58
parenteb83e4c64b5a3458569593c2ab0c29365f10a82f
builtin/cat-file: support "blob:none" objects filter

Implement support for the "blob:none" filter in git-cat-file(1), which
causes us to omit all blobs.

Note that this new filter requires us to read the object type via
`oid_object_info_extended()` in `batch_object_write()`. But as we try to
optimize away reading objects from the database the `data->info.typep`
pointer may not be set. We thus have to adapt the logic to conditionally
set the pointer in cases where the filter is given.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cat-file.adoc
builtin/cat-file.c
t/t1006-cat-file.sh