From 2979041bc5beca760d30b965e60f41a3484f55b7 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 18 Apr 2023 11:10:40 +0800 Subject: [PATCH] Fix incorrect internal response type (#24173) Close #24167 The endpoint "set-default-branch" returns `success`, so just decode it as `responseText` --- modules/private/hook.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/private/hook.go b/modules/private/hook.go index 0563e4d80a6..c0fe9ef1fb3 100644 --- a/modules/private/hook.go +++ b/modules/private/hook.go @@ -129,7 +129,8 @@ func SetDefaultBranch(ctx context.Context, ownerName, repoName, branch string) R url.PathEscape(branch), ) req := newInternalRequest(ctx, reqURL, "POST") - return requestJSONUserMsg(req, "") + _, extra := requestJSONResp(req, &responseText{}) + return extra } // SSHLog sends ssh error log response