From: Junio C Hamano Date: Sun, 13 Aug 2006 05:16:51 +0000 (-0700) Subject: Merge branch 'jc/upload-pack' X-Git-Tag: v1.4.3-rc1~267 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=182a8dabd5f5f646608f3857f10f3ac18c3d1445;p=git.git Merge branch 'jc/upload-pack' --- 182a8dabd5f5f646608f3857f10f3ac18c3d1445 diff --cc upload-pack.c index 07ecdb428,5a911d6fb..bbd6bd60b --- a/upload-pack.c +++ b/upload-pack.c @@@ -326,24 -322,23 +328,23 @@@ static int got_sha1(char *hex, unsigne 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; }