rev-list: handle flags for --indexed-objects
commitb4cfcde4db8f5787c6c8a3912b0f2667becd1995
authorJeff King <peff@peff.net>
Fri, 2 Nov 2018 05:22:59 +0000 (2 01:22 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 11:49:52 +0000 (2 20:49 +0900)
tree70c0443f5cd536fc7daa1979893d6c9683eb5e34
parentd582ea202b626dcc6c3b01e1e11a296d9badd730
rev-list: handle flags for --indexed-objects

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>
revision.c
t/t6000-rev-list-misc.sh