Skip to content

Commit bbfe5f2

Browse files
committed
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
2 parents 098e8c6 + 72ed80c commit bbfe5f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

list-objects.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ static void do_traverse(struct traversal_context *ctx)
365365
* an uninteresting boundary commit may not have its tree
366366
* parsed yet, but we are not going to show them anyway
367367
*/
368-
if (get_commit_tree(commit)) {
368+
if (!ctx->revs->tree_objects)
369+
; /* do not bother loading tree */
370+
else if (get_commit_tree(commit)) {
369371
struct tree *tree = get_commit_tree(commit);
370372
tree->object.flags |= NOT_USER_GIVEN;
371373
add_pending_tree(ctx->revs, tree);

0 commit comments

Comments
 (0)