diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep snapshot members from starting at a slash
A name that was all suffix, such as .tar, settled on a ref called v
with an empty prefix, and an empty snapshot-prefix did the same for a
snapshot asked for by id, so every member of the archive started at /.
Diffstat (limited to 'tests/t0110-snapshot.sh')
| -rwxr-xr-x | tests/t0110-snapshot.sh | 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 21 insertions, 0 deletions
diff --git a/tests/t0110-snapshot.sh b/tests/t0110-snapshot.sh index 4852e7b..ec0a0b8 100755 --- a/tests/t0110-snapshot.sh +++ b/tests/t0110-snapshot.sh @@ -146,4 +146,25 @@ test_expect_success 'a real case collision keeps the v on both tags' ' ! grep "vtags-1.0.tar.gz" tmp ' +# A name that is all suffix names no revision, and an empty snapshot-prefix +# gives the members no leading directory rather than a leading slash. +test_expect_success 'a snapshot name with nothing before its suffix is refused' ' + git -C repos/vtags branch v HEAD && + sed "s/^snapshots=tar.gz$/snapshots=tar/" vtagsrc >vtagstarrc && + CGIT_CONFIG="$PWD/vtagstarrc" QUERY_STRING="url=vtags/snapshot/.tar" cgit >tmp && + grep "^Status: 404" tmp +' + +test_expect_success 'an empty snapshot-prefix puts no slash ahead of the members' ' + { + cat vtagstarrc && + echo "repo.snapshot-prefix=" + } >noprefixrc && + CGIT_CONFIG="$PWD/noprefixrc" QUERY_STRING="url=vtags/snapshot/vtags.tar&id=master" cgit >tmp && + strip_headers <tmp >noprefix.tar && + tar -tf noprefix.tar >members && + grep "^file-1$" members && + ! grep "^/" members +' + test_done |
