Merge branch 'jk/fetch-mark-complete-optimization'
authorJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2011 17:32:11 +0000 (10:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2011 17:32:11 +0000 (10:32 -0700)
* jk/fetch-mark-complete-optimization:
fetch: avoid repeated commits in mark_complete

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;
 }