Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-07 05:32:56 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-07 05:32:56 +0300
commitbbfe5f2241f8baf6019c6cb7428aed9fb1353799 (patch)
tree0aaf2e02dbed7c800a5b3b934b676a0e61eaead9 /list-objects.c
parent098e8c6716b8c6abc29b6788acdb3ac8725f835d (diff)
parent72ed80c784e65770c4d4944b0ea54b08e098d7e3 (diff)
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 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);