summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t5500-fetch-pack.sh9
-rw-r--r--upload-pack.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index e80a2af348..e202383e4f 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -331,6 +331,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
diff --git a/upload-pack.c b/upload-pack.c
index e29d5d2085..b6ec605b09 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -639,7 +639,7 @@ static void receive_needs(void)
use_include_tag = 1;
o = lookup_object(sha1_buf);
- if (!o)
+ if (!o || !parse_object(o->sha1))
die("git upload-pack: not our ref %s",
sha1_to_hex(sha1_buf));
if (!(o->flags & WANTED)) {