summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61420a2)
raw | patch | inline | side by side (parent: 61420a2)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Thu, 15 Sep 2005 01:31:42 +0000 (21:31 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Sep 2005 20:19:29 +0000 (13:19 -0700) |
Don't assume that any commit we have is complete; assume that any ref
we have is complete.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
we have is complete.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch.c | patch | blob | history |
index e874538ccc14c58dfaa279d8957d309037a6c388..7db35f0dcc38276e32152a99b278429be955b992 100644 (file)
--- a/fetch.c
+++ b/fetch.c
return 0;
}
+struct commit_list *complete = NULL;
+
static int process_commit(struct commit *commit)
{
if (parse_commit(commit))
return -1;
+ while (complete && complete->item->date >= commit->date) {
+ pop_most_recent_commit(&complete, 1);
+ }
+
+
+ if (commit->object.flags & 1)
+ return 0;
+
memcpy(current_commit_sha1, commit->object.sha1, 20);
if (get_tree) {
if (get_history) {
struct commit_list *parents = commit->parents;
for (; parents; parents = parents->next) {
- if (has_sha1_file(parents->item->object.sha1))
- continue;
if (process(parents->item->object.sha1,
commit_type))
return -1;
static int process(unsigned char *sha1, const char *type)
{
struct object *obj = lookup_object_type(sha1, type);
+
if (has_sha1_file(sha1)) {
parse_object(sha1);
/* We already have it, so we should scan it now. */
return -1;
}
+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);
+ }
+ return 0;
+}
int pull(char *target)
{
return -1;
}
+ for_each_ref(mark_complete);
+
if (interpret_target(target, sha1))
return error("Could not interpret %s as something to pull",
target);