]> git.ipfire.org Git - thirdparty/git.git/commit - bundle.c
bundle: create filtered bundles
authorDerrick Stolee <derrickstolee@github.com>
Wed, 9 Mar 2022 16:01:41 +0000 (16:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Mar 2022 18:25:28 +0000 (10:25 -0800)
commitf18b512bbba8ee508fec64698f581920bfa5b46d
treeb7eba704ea444183d58dbab76d68078e8005da5a
parentc4ea513f4aea64e1ab03309dddff046852bddb74
bundle: create filtered bundles

A previous change allowed Git to parse bundles with the 'filter'
capability. Now, teach Git to create bundles with this option.

Some rearranging of code is required to get the option parsing in the
correct spot. There are now two reasons why we might need capabilities
(a new hash algorithm or an object filter) so that is pulled out into a
place where we can check both at the same time.

The --filter option is parsed as part of setup_revisions(), but it
expected the --objects flag, too. That flag is somewhat implied by 'git
bundle' because it creates a pack-file walking objects, but there is
also a walk that walks the revision range expecting only commits. Make
this parsing work by setting 'revs.tree_objects' and 'revs.blob_objects'
before the call to setup_revisions().

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle.c
t/t6020-bundle-misc.sh