rev-list: handle flags for --indexed-objects
authorJeff King <peff@peff.net>
Fri, 2 Nov 2018 05:22:59 +0000 (01:22 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 11:49:52 +0000 (20:49 +0900)
When a traversal sees the --indexed-objects option, it adds
all blobs and valid cache-trees from the index to the
traversal using add_index_objects_to_pending(). But that
function totally ignores its flags parameter!

That means that doing:

git rev-list --objects --indexed-objects

and

git rev-list --objects --not --indexed-objects

produce the same output, because we ignore the UNINTERESTING
flag when walking the index in the second example.

Nobody noticed because this feature was added as a way for
tools like repack to increase their coverage of reachable
objects, meaning it would only be used like the first
example above.

But since it's user facing (and because the documentation
describes it "as if the objects are listed on the command
line"), we should make sure the negative case behaves
sensibly.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found