summaryrefslogtreecommitdiff
path: root/list-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-07 02:32:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 02:32:56 (GMT)
commitbbfe5f2241f8baf6019c6cb7428aed9fb1353799 (patch)
tree0aaf2e02dbed7c800a5b3b934b676a0e61eaead9 /list-objects.c
parent098e8c6716b8c6abc29b6788acdb3ac8725f835d (diff)
parent72ed80c784e65770c4d4944b0ea54b08e098d7e3 (diff)
downloadgit-bbfe5f2241f8baf6019c6cb7428aed9fb1353799.zip
git-bbfe5f2241f8baf6019c6cb7428aed9fb1353799.tar.gz
git-bbfe5f2241f8baf6019c6cb7428aed9fb1353799.tar.bz2
Merge branch 'jk/list-objects-optim-wo-trees'
The object traversal machinery has been optimized not to load tree objects when we are only interested in commit history. * jk/list-objects-optim-wo-trees: list-objects: don't queue root trees unless revs->tree_objects is set
Diffstat (limited to 'list-objects.c')
-rw-r--r--list-objects.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/list-objects.c b/list-objects.c
index 9307d91..e19589b 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -365,7 +365,9 @@ static void do_traverse(struct traversal_context *ctx)
* an uninteresting boundary commit may not have its tree
* parsed yet, but we are not going to show them anyway
*/
- if (get_commit_tree(commit)) {
+ if (!ctx->revs->tree_objects)
+ ; /* do not bother loading tree */
+ else if (get_commit_tree(commit)) {
struct tree *tree = get_commit_tree(commit);
tree->object.flags |= NOT_USER_GIVEN;
add_pending_tree(ctx->revs, tree);