diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Send a clone file with its size in whole batches
The dumb transport read a pack four kilobytes at a time through stdio
and sent it without a length, so a client could not tell a cut-off
transfer from a complete one.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0303-robustness.sh | 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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) && ( |
