summaryrefslogtreecommitdiff
path: root/rev-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org.(none)>2005-04-19 16:52:24 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org.(none)>2005-04-19 16:52:24 (GMT)
commit3b7d368f34715003c834233d9f23456bcb62b44a (patch)
treec3963ca87888c3957622af0558c62e519fdd3b70 /rev-tree.c
parent0a9ea850005de0fb74b6288d281eb0417e869b00 (diff)
downloadgit-3b7d368f34715003c834233d9f23456bcb62b44a.zip
git-3b7d368f34715003c834233d9f23456bcb62b44a.tar.gz
git-3b7d368f34715003c834233d9f23456bcb62b44a.tar.bz2
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.
Diffstat (limited to 'rev-tree.c')
-rw-r--r--rev-tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rev-tree.c b/rev-tree.c
index c3884e3..ebeceb0 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;