summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:27 -0800
commitd5120daba4f91c97fb9eb77e32f0f9e009bb515a (patch)
treed3fb871acb99c442aa60fb26df7819cb45e719c7
parentMerge branch 'ds/find-unique-abbrev-optim' (diff)
parentrevision.c: reduce object database queries (diff)
downloadtgif-d5120daba4f91c97fb9eb77e32f0f9e009bb515a.tar.xz
Merge branch 'ds/mark-parents-uninteresting-optim'
Micro optimization in revision traversal code. * ds/mark-parents-uninteresting-optim: revision.c: reduce object database queries
-rw-r--r--revision.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 5c1cb7277c..b42c836d7a 100644
--- a/revision.c
+++ b/revision.c
@@ -113,7 +113,8 @@ void mark_parents_uninteresting(struct commit *commit)
* it is popped next time around, we won't be trying
* to parse it and get an error.
*/
- if (!has_object_file(&commit->object.oid))
+ if (!commit->object.parsed &&
+ !has_object_file(&commit->object.oid))
commit->object.parsed = 1;
if (commit->object.flags & UNINTERESTING)