diff options
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/hook.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/private/hook.go b/modules/private/hook.go index 7e2a475d4b..caa3819555 100644 --- a/modules/private/hook.go +++ b/modules/private/hook.go @@ -29,11 +29,12 @@ type HookOptions struct { UserName string GitObjectDirectory string GitAlternativeObjectDirectories string + ProtectedBranchID int64 } // HookPreReceive check whether the provided commits are allowed func HookPreReceive(ownerName, repoName string, opts HookOptions) (int, string) { - reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/pre-receive/%s/%s?old=%s&new=%s&ref=%s&userID=%d&gitObjectDirectory=%s&gitAlternativeObjectDirectories=%s", + reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/pre-receive/%s/%s?old=%s&new=%s&ref=%s&userID=%d&gitObjectDirectory=%s&gitAlternativeObjectDirectories=%s&prID=%d", url.PathEscape(ownerName), url.PathEscape(repoName), url.QueryEscape(opts.OldCommitID), @@ -42,6 +43,7 @@ func HookPreReceive(ownerName, repoName string, opts HookOptions) (int, string) opts.UserID, url.QueryEscape(opts.GitObjectDirectory), url.QueryEscape(opts.GitAlternativeObjectDirectories), + opts.ProtectedBranchID, ) resp, err := newInternalRequest(reqURL, "GET").Response() |