aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-10-03 16:13:49 +0800
committerGitHub <noreply@github.com>2023-10-03 08:13:49 +0000
commit8c6464e39b5069ebfca254a9b7867f9b7fa57bd9 (patch)
tree0f9b9d70d026f5e6fe0562a78d211c8cab443b49 /tests
parent4f02b4a7b9912c11971b335cb8b14fcd229bc5af (diff)
downloadgitea-8c6464e39b5069ebfca254a9b7867f9b7fa57bd9.tar.gz
gitea-8c6464e39b5069ebfca254a9b7867f9b7fa57bd9.zip
Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
Backport #27384 by @rbhz Add support for HEAD in paths: ``` /src/branch/HEAD/README.md /src/commit/HEAD/README.md ``` Closes #26920 Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/repo_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go
index 99a27d6a7f..f5417b100c 100644
--- a/tests/integration/repo_test.go
+++ b/tests/integration/repo_test.go
@@ -302,6 +302,10 @@ func TestViewRepoDirectoryReadme(t *testing.T) {
check("plain", "/user2/readme-test/src/branch/plain/", "README", "plain-text", "Birken my stocks gee howdy")
check("i18n", "/user2/readme-test/src/branch/i18n/", "README.zh.md", "markdown", "蛋糕是一个谎言")
+ // using HEAD ref
+ check("branch-HEAD", "/user2/readme-test/src/branch/HEAD/", "README.md", "markdown", "The cake is a lie.")
+ check("commit-HEAD", "/user2/readme-test/src/commit/HEAD/", "README.md", "markdown", "The cake is a lie.")
+
// viewing different subdirectories
check("subdir", "/user2/readme-test/src/branch/subdir/libcake", "README.md", "markdown", "Four pints of sugar.")
check("docs-direct", "/user2/readme-test/src/branch/special-subdir-docs/docs/", "README.md", "markdown", "This is in docs/")