Skip to content

Commit ce5e953

Browse files
committed
Merge branch 'jk/fetch-mark-complete-optimization'
* jk/fetch-mark-complete-optimization: fetch: avoid repeated commits in mark_complete
2 parents a6f3f17 + ea5f220 commit ce5e953

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin/fetch-pack.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,10 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
472472
}
473473
if (o && o->type == OBJ_COMMIT) {
474474
struct commit *commit = (struct commit *)o;
475-
commit->object.flags |= COMPLETE;
476-
commit_list_insert_by_date(commit, &complete);
475+
if (!(commit->object.flags & COMPLETE)) {
476+
commit->object.flags |= COMPLETE;
477+
commit_list_insert_by_date(commit, &complete);
478+
}
477479
}
478480
return 0;
479481
}

0 commit comments

Comments
 (0)