0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-19 20:35:11 +02:00

fix maybeGroupSegment func, run formatter

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-11-23 21:57:31 -05:00
parent d36d700ee8
commit 32e8a6dfd4
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
3 changed files with 38 additions and 46 deletions

View File

@ -122,7 +122,7 @@ func testEditorActionEdit(t *testing.T, session *TestSession, groupID int64, use
params["tree_path"] = util.IfZero(params["tree_path"], filePath) params["tree_path"] = util.IfZero(params["tree_path"], filePath)
newBranchName := util.Iif(params["commit_choice"] == "direct", branch, params["new_branch_name"]) newBranchName := util.Iif(params["commit_choice"] == "direct", branch, params["new_branch_name"])
resp := testEditorActionPostRequest(t, session, fmt.Sprintf("/%s/%s/%s%s/%s/%s", user, maybeWebGroupSegment(groupID), repo, editorAction, branch, filePath), params) resp := testEditorActionPostRequest(t, session, fmt.Sprintf("/%s/%s/%s%s/%s/%s", user, maybeGroupSegment(groupID), repo, editorAction, branch, filePath), params)
assert.Equal(t, http.StatusOK, resp.Code) assert.Equal(t, http.StatusOK, resp.Code)
assert.NotEmpty(t, test.RedirectURL(resp)) assert.NotEmpty(t, test.RedirectURL(resp))
req := NewRequest(t, "GET", path.Join(user, repo, "raw/branch", newBranchName, params["tree_path"])) req := NewRequest(t, "GET", path.Join(user, repo, "raw/branch", newBranchName, params["tree_path"]))

View File

@ -7,15 +7,7 @@ import "fmt"
func maybeGroupSegment(gid int64) string { func maybeGroupSegment(gid int64) string {
if gid > 0 { if gid > 0 {
return fmt.Sprintf("%d/", gid) return fmt.Sprintf("group/%d/", gid)
}
return ""
}
func maybeWebGroupSegment(gid int64) string {
gs := maybeGroupSegment(gid)
if gs != "" {
return "group/" + gs
} }
return "" return ""
} }