[BUG] Allow 4 charachter SHA in /src/commit
- Adjust the `RepoRefByType` middleware to allow for commit SHAs that
are as short as 4 characters (the minium that Git requires).
- Integration test added.
- Follow up to 4d76bbeda7
- Resolves #4781
This commit is contained in:
parent
641b0f74b6
commit
b967fce25d
2 changed files with 9 additions and 2 deletions
|
@ -710,6 +710,13 @@ func TestCommitView(t *testing.T) {
|
|||
doc := NewHTMLParser(t, resp.Body)
|
||||
commitTitle := doc.Find(".commit-summary").Text()
|
||||
assert.Contains(t, commitTitle, "Initial commit")
|
||||
|
||||
req = NewRequest(t, "GET", "/user2/repo1/src/commit/65f1")
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
doc = NewHTMLParser(t, resp.Body)
|
||||
commitTitle = doc.Find(".shortsha").Text()
|
||||
assert.Contains(t, commitTitle, "65f1bf27bc")
|
||||
})
|
||||
|
||||
t.Run("Full commit ID", func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue