fetch: avoid repeated commits in mark_complete
[gitweb.git] / builtin / fetch-pack.c
index 85aff029b225c023f09fda635f16cc00a22ed7ca..56c0b4a38d30a9c32b3bee99022d19066aaa8d29 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;
 }