summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-10-07 11:32:56 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-07 11:32:56 +0900
commitbbfe5f2241f8baf6019c6cb7428aed9fb1353799 (patch)
tree0aaf2e02dbed7c800a5b3b934b676a0e61eaead9
parentMerge branch 'jk/disable-commit-graph-during-upload-pack' (diff)
parentlist-objects: don't queue root trees unless revs->tree_objects is set (diff)
downloadtgif-bbfe5f2241f8baf6019c6cb7428aed9fb1353799.tar.xz
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
-rw-r--r--list-objects.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/list-objects.c b/list-objects.c
index 9307d91fb3..e19589baa0 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);