commit: factor out clear_commit_marks_for_object_array
[gitweb.git] / builtin / fetch-pack.c
index 60a17c74ef9196e6afc468539ecf67a9d310495e..436798410210b868cfbe439a1603b0a340a32c50 100644 (file)
@@ -472,8 +472,10 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
        }
        if (o && o->type == OBJ_COMMIT) {
                struct commit *commit = (struct commit *)o;
-               commit->object.flags |= COMPLETE;
-               commit_list_insert_by_date(commit, &complete);
+               if (!(commit->object.flags & COMPLETE)) {
+                       commit->object.flags |= COMPLETE;
+                       commit_list_insert_by_date(commit, &complete);
+               }
        }
        return 0;
 }