Skip to content

Commit

Permalink
Merge branch 'jk/peel-ref' into maint
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Junio C Hamano committed Apr 4, 2013
2 parents 9b924ee + f59de5d commit 5ccb7e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions t/t5500-fetch-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ EOF
test_cmp count7.expected count7.actual
'

test_expect_success 'clone shallow with packed refs' '
git pack-refs --all &&
git clone --depth 1 --branch A "file://$(pwd)/." shallow8 &&
echo "in-pack: 4" > count8.expected &&
GIT_DIR=shallow8/.git git count-objects -v |
grep "^in-pack" > count8.actual &&
test_cmp count8.expected count8.actual
'

test_expect_success 'setup tests for the --stdin parameter' '
for head in C D E F
do
Expand Down
6 changes: 2 additions & 4 deletions upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,7 @@ static int got_sha1(char *hex, unsigned char *sha1)
if (!has_sha1_file(sha1))
return -1;

o = lookup_object(sha1);
if (!(o && o->parsed))
o = parse_object(sha1);
o = parse_object(sha1);
if (!o)
die("oops (%s)", sha1_to_hex(sha1));
if (o->type == OBJ_COMMIT) {
Expand Down Expand Up @@ -640,7 +638,7 @@ static void receive_needs(void)
if (parse_feature_request(features, "include-tag"))
use_include_tag = 1;

o = lookup_object(sha1_buf);
o = parse_object(sha1_buf);
if (!o)
die("git upload-pack: not our ref %s",
sha1_to_hex(sha1_buf));
Expand Down

0 comments on commit 5ccb7e2

Please sign in to comment.