fetch-pack: do not stop traversing an already parsed commit
f3ec549 (fetch-pack: check parse_commit/object results, 2008-03-03) broke common ancestor computation by stopping traversal when it sees an already parsed commit. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Linus Torvalds committed
Apr 28, 2008 at 16:27 UTC
72269ad9564b700e6aab30338e35b4e6ffea854d
1 file changed
+4
-4
builtin-fetch-pack.c
+4
-4
@@ -117,15 +117,15 @@ static const unsigned char* get_rev(void)
117
118
while (commit == NULL) {
119
unsigned int mark;
120
- struct commit_list *parents = NULL;
120
+ struct commit_list *parents;
121
122
if (rev_list == NULL || non_common_revs == 0)
123
return NULL;
124
125
commit = rev_list->item;
126
- if (!(commit->object.parsed))
127
- if (!parse_commit(commit))
128
- parents = commit->parents;
126
+ if (commit->object.parsed)
127
+ parse_commit(commit);
128
+ parents = commit->parents;
129
130
commit->object.flags |= POPPED;
131
if (!(commit->object.flags & COMMON))