Skip to content

Commit 72269ad

Browse files
torvaldsgitster
authored andcommitted
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>
1 parent e42251a commit 72269ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin-fetch-pack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ static const unsigned char* get_rev(void)
117117

118118
while (commit == NULL) {
119119
unsigned int mark;
120-
struct commit_list *parents = NULL;
120+
struct commit_list *parents;
121121

122122
if (rev_list == NULL || non_common_revs == 0)
123123
return NULL;
124124

125125
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;
129129

130130
commit->object.flags |= POPPED;
131131
if (!(commit->object.flags & COMMON))

0 commit comments

Comments
 (0)