Skip to content
  • Jeff King's avatar
    rev-list: handle flags for --indexed-objects · b4cfcde4
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b4cfcde4