diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0303-robustness.sh15
1 file changed, 15 insertions, 0 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh
index cb16957..8d64c1e 100755
--- a/tests/t0303-robustness.sh
+++ b/tests/t0303-robustness.sh
@@ -479,6 +479,21 @@ test_expect_success 'the dumb transport serves an empty repository' '
grep "^Status: 404" tmp
'
+# A pack is handed over as it sits on the disk, so the client can be told
+# its size up front and compare what arrived against it.
+test_expect_success 'the dumb transport sends a file with its size' '
+ git -C repos/rob repack -q -d &&
+ robq "url=rob/objects/info/packs" >tmp &&
+ pack=$(strip_headers <tmp | sed -n "s/^P //p" | head -1) &&
+ test -n "$pack" &&
+ robq "url=rob/objects/pack/$pack" >tmp &&
+ grep "^Status: 200" tmp &&
+ size=$(wc -c <repos/rob/.git/objects/pack/$pack | tr -d " ") &&
+ grep "^Content-Length: $size$" tmp &&
+ strip_headers <tmp >body &&
+ cmp body repos/rob/.git/objects/pack/$pack
+'
+
test_expect_success 'a symlink whose target is a large blob is listed without it' '
big=$(head -c 5000 /dev/zero | tr "\0" a | git -C repos/rob hash-object -w --stdin) &&
(