diff options
author | Kirill Sorokin <48334247+rbhz@users.noreply.github.com> | 2023-10-03 10:37:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 15:37:06 +0800 |
commit | 2b06c106ef08036659684bdd2882a05b9b48afd7 (patch) | |
tree | 66db92cab6fe7e82f95b11a537d5c79635724ecd /tests/integration | |
parent | bc21723717a00888722c86641b70371a811867f9 (diff) | |
download | gitea-2b06c106ef08036659684bdd2882a05b9b48afd7.tar.gz gitea-2b06c106ef08036659684bdd2882a05b9b48afd7.zip |
Add support for HEAD ref in /src/branch and /src/commit routes (#27384)
Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```
Closes #26920
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/repo_test.go | 4 |
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/") |