Skip to content

Commit 5ccb7e2

Browse files
committed
Merge branch 'jk/peel-ref' into maint
* jk/peel-ref: upload-pack: load non-tip "want" objects from disk upload-pack: make sure "want" objects are parsed upload-pack: drop lookup-before-parse optimization
2 parents 9b924ee + f59de5d commit 5ccb7e2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

t/t5500-fetch-pack.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ EOF
364364
test_cmp count7.expected count7.actual
365365
'
366366

367+
test_expect_success 'clone shallow with packed refs' '
368+
git pack-refs --all &&
369+
git clone --depth 1 --branch A "file://$(pwd)/." shallow8 &&
370+
echo "in-pack: 4" > count8.expected &&
371+
GIT_DIR=shallow8/.git git count-objects -v |
372+
grep "^in-pack" > count8.actual &&
373+
test_cmp count8.expected count8.actual
374+
'
375+
367376
test_expect_success 'setup tests for the --stdin parameter' '
368377
for head in C D E F
369378
do

upload-pack.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,7 @@ static int got_sha1(char *hex, unsigned char *sha1)
325325
if (!has_sha1_file(sha1))
326326
return -1;
327327

328-
o = lookup_object(sha1);
329-
if (!(o && o->parsed))
330-
o = parse_object(sha1);
328+
o = parse_object(sha1);
331329
if (!o)
332330
die("oops (%s)", sha1_to_hex(sha1));
333331
if (o->type == OBJ_COMMIT) {
@@ -640,7 +638,7 @@ static void receive_needs(void)
640638
if (parse_feature_request(features, "include-tag"))
641639
use_include_tag = 1;
642640

643-
o = lookup_object(sha1_buf);
641+
o = parse_object(sha1_buf);
644642
if (!o)
645643
die("git upload-pack: not our ref %s",
646644
sha1_to_hex(sha1_buf));

0 commit comments

Comments
 (0)