summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2842375)
raw | patch | inline | side by side (parent: 2842375)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 16 Sep 2005 21:30:29 +0000 (14:30 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 16 Sep 2005 22:16:45 +0000 (15:16 -0700) |
Clean-ups suggested by Sergey Vlasov and acked by Daniel Barkalow.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch.c | patch | blob | history |
index 71c4f41a66224046d2b377b0e828f837be9e850c..6ee61616dcd127cb97c1c39c401cdb51b953bddd 100644 (file)
--- a/fetch.c
+++ b/fetch.c
return 0;
}
-struct commit_list *complete = NULL;
+#define COMPLETE 1U
+static struct commit_list *complete = NULL;
static int process_commit(struct commit *commit)
{
return -1;
while (complete && complete->item->date >= commit->date) {
- pop_most_recent_commit(&complete, 1);
+ pop_most_recent_commit(&complete, COMPLETE);
}
- if (commit->object.flags & 1)
+ if (commit->object.flags & COMPLETE)
return 0;
memcpy(current_commit_sha1, commit->object.sha1, 20);
static int mark_complete(const char *path, const unsigned char *sha1)
{
- struct object *obj = parse_object(sha1);
- while (obj->type == tag_type) {
- obj = ((struct tag *) obj)->tagged;
- parse_object(obj->sha1);
- }
- if (obj->type == commit_type) {
- obj->flags |= 1;
- insert_by_date((struct commit *) obj, &complete);
+ struct commit *commit = lookup_commit_reference_gently(sha1, 1);
+ if (commit) {
+ commit->object.flags |= COMPLETE;
+ insert_by_date(commit, &complete);
}
return 0;
}