From: Linus Torvalds Date: Tue, 19 Apr 2005 16:52:24 +0000 (-0700) Subject: Don't parse commit objects more than once. X-Git-Tag: v0.99~814 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3b7d368f34715003c834233d9f23456bcb62b44a;p=git.git Don't parse commit objects more than once. Yes, the "parse_commit()" already checks for this condition, but we need to check for it in rev-tree too, so that we don't start walking the parent chain unnecessarily. --- diff --git a/rev-tree.c b/rev-tree.c index c3884e35..ebeceb07 100644 --- a/rev-tree.c +++ b/rev-tree.c @@ -55,6 +55,10 @@ void process_commit(unsigned char *sha1) { struct commit_list *parents; struct commit *obj = lookup_commit(sha1); + + if (obj->object.parsed) + return; + parse_commit(obj); parents = obj->parents;