diff options
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0110-snapshot.sh9
1 file changed, 9 insertions, 0 deletions
diff --git a/tests/t0110-snapshot.sh b/tests/t0110-snapshot.sh
index 373a05d..2ce8316 100755
--- a/tests/t0110-snapshot.sh
+++ b/tests/t0110-snapshot.sh
@@ -181,4 +181,13 @@ test_expect_success GZIP 'a compressed snapshot is made without a PATH' '
gzip -t nopath.tar.gz
'
+# A link offers the snapshot of a tag, and the name on it has to lead back to
+# that tag even when a branch is spelled like the tag's stem.
+test_expect_success 'a snapshot name leads to the tag ahead of a branch' '
+ git -C repos/vtags update-ref refs/heads/1.0 $(git -C repos/vtags commit-tree -m shadow HEAD^{tree}) &&
+ CGIT_CONFIG="$PWD/vtagsrc" QUERY_STRING="url=vtags/snapshot/vtags-1.0.tar.gz" cgit >tmp &&
+ strip_headers <tmp >tag.tar.gz &&
+ test "$(gzip -dc tag.tar.gz | git -C repos/vtags get-tar-commit-id)" = "$(git -C repos/vtags rev-parse refs/tags/v1.0^{commit})"
+'
+
test_done