Merge branch 'ds/mark-parents-uninteresting-optim'
authorJunio C Hamano <gitster@pobox.com>
Thu, 8 Mar 2018 20:36:27 +0000 (12:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Mar 2018 20:36:27 +0000 (12:36 -0800)
Micro optimization in revision traversal code.

* ds/mark-parents-uninteresting-optim:
revision.c: reduce object database queries

revision.c
index 5c1cb7277c2fef11c473fbb3f6a9c04e0d83ca70..b42c836d7a64a67779c587954bcab90d919aaffb 100644 (file)
@@ -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)