Skip to content

Commit 0114ae2

Browse files
committed
Make any non-200 status code from pre-receive an error
1 parent 66d8018 commit 0114ae2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/hook.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ Gitea or set your environment appropriately.`, "")
132132
hookOptions.RefFullNames = refFullNames
133133
statusCode, msg := private.HookPreReceive(username, reponame, hookOptions)
134134
switch statusCode {
135+
case http.StatusOK:
136+
// no-op
135137
case http.StatusInternalServerError:
136138
fail("Internal Server Error", msg)
137-
case http.StatusForbidden:
139+
default:
138140
fail(msg, "")
139141
}
140142
count = 0

0 commit comments

Comments
 (0)