author | Junio C Hamano <junkio@cox.net> | |
Sun, 13 Aug 2006 05:16:51 +0000 (22:16 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 13 Aug 2006 05:16:51 +0000 (22:16 -0700) |
1 | 2 | |||
---|---|---|---|---|
upload-pack.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc upload-pack.c
index 07ecdb4281cfb32cf16dfc7c46c53e6e8d0247bc,5a911d6fb52757b4f988193eb37eeee54e5002ce..bbd6bd60b52d806be0a69324009755f49b070082
--- 1/upload-pack.c
--- 2/upload-pack.c
+++ b/upload-pack.c
die("git-upload-pack: expected SHA1 object, got '%s'", hex);
if (!has_sha1_file(sha1))
return 0;
- if (nr_has < MAX_HAS) {
- struct object *o = lookup_object(sha1);
- if (!(o && o->parsed))
- o = parse_object(sha1);
- if (!o)
- die("oops (%s)", sha1_to_hex(sha1));
- if (o->type == OBJ_COMMIT) {
- struct commit_list *parents;
- if (o->flags & THEY_HAVE)
- return 0;
- o->flags |= THEY_HAVE;
- for (parents = ((struct commit*)o)->parents;
- parents;
- parents = parents->next)
- parents->item->object.flags |= THEY_HAVE;
- }
- memcpy(has_sha1[nr_has++], sha1, 20);
+
+ o = lookup_object(sha1);
+ if (!(o && o->parsed))
+ o = parse_object(sha1);
+ if (!o)
+ die("oops (%s)", sha1_to_hex(sha1));
- if (o->type == TYPE_COMMIT) {
++ if (o->type == OBJ_COMMIT) {
+ struct commit_list *parents;
+ if (o->flags & THEY_HAVE)
+ return 0;
+ o->flags |= THEY_HAVE;
+ for (parents = ((struct commit*)o)->parents;
+ parents;
+ parents = parents->next)
+ parents->item->object.flags |= THEY_HAVE;
}
+ add_object_array(o, NULL, &have_obj);
return 1;
}