]> git.ipfire.org Git - thirdparty/git.git/commit - list-objects.c
Make rev-list --objects work together with pathspecs
authorElijah Newren <newren@gmail.com>
Fri, 17 Dec 2010 13:26:47 +0000 (20:26 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Feb 2011 22:10:46 +0000 (14:10 -0800)
commitcc5fa2fdafa186d6e1e310828b22d0028e1fb51b
treeb29c740aed0ae94a7e2367d0f82cccfd42574b01
parentf577b92fe75643228674c0dcb2a4747587cf541d
Make rev-list --objects work together with pathspecs

When traversing commits, the selection of commits would heed the list of
pathspecs passed, but subsequent walking of the trees of those commits
would not.  This resulted in 'rev-list --objects HEAD -- <paths>'
displaying objects at unwanted paths.

Have process_tree() call tree_entry_interesting() to determine which paths
are interesting and should be walked.

Naturally, this change can provide a large speedup when paths are specified
together with --objects, since many tree entries are now correctly ignored.
Interestingly, though, this change also gives me a small (~1%) but
repeatable speedup even when no paths are specified with --objects.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects.c