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
This commit is contained in:
parent
bc21723717
commit
2b06c106ef
2 changed files with 24 additions and 0 deletions
|
@ -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/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue