Skip to content

Commit 24ebe0f

Browse files
authored
Merge branch 'main' into b/improved-resource-string
2 parents cee919f + 74d75eb commit 24ebe0f

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

modules/private/hook.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ type HookPostReceiveBranchResult struct {
8181
URL string
8282
}
8383

84-
// HockProcReceiveResult represents an individual result from ProcReceive
85-
type HockProcReceiveResult struct {
86-
Results []HockProcReceiveRefResult
84+
// HookProcReceiveResult represents an individual result from ProcReceive
85+
type HookProcReceiveResult struct {
86+
Results []HookProcReceiveRefResult
8787
Err string
8888
}
8989

90-
// HockProcReceiveRefResult represents an individual result from ProcReceive
91-
type HockProcReceiveRefResult struct {
90+
// HookProcReceiveRefResult represents an individual result from ProcReceive
91+
type HookProcReceiveRefResult struct {
9292
OldOID string
9393
NewOID string
9494
Ref string
@@ -150,7 +150,7 @@ func HookPostReceive(ctx context.Context, ownerName, repoName string, opts HookO
150150
}
151151

152152
// HookProcReceive proc-receive hook
153-
func HookProcReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) (*HockProcReceiveResult, error) {
153+
func HookProcReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) (*HookProcReceiveResult, error) {
154154
reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/proc-receive/%s/%s",
155155
url.PathEscape(ownerName),
156156
url.PathEscape(repoName),
@@ -170,7 +170,7 @@ func HookProcReceive(ctx context.Context, ownerName, repoName string, opts HookO
170170
if resp.StatusCode != http.StatusOK {
171171
return nil, errors.New(decodeJSONError(resp).Err)
172172
}
173-
res := &HockProcReceiveResult{}
173+
res := &HookProcReceiveResult{}
174174
_ = json.NewDecoder(resp.Body).Decode(res)
175175

176176
return res, nil

routers/private/hook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ func HookProcReceive(ctx *gitea_context.PrivateContext) {
668668
return
669669
}
670670

671-
ctx.JSON(http.StatusOK, private.HockProcReceiveResult{
671+
ctx.JSON(http.StatusOK, private.HookProcReceiveResult{
672672
Results: results,
673673
})
674674
}

services/agit/agit.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
// ProcRecive handle proc receive work
23-
func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []private.HockProcReceiveRefResult {
23+
func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []private.HookProcReceiveRefResult {
2424
// TODO: Add more options?
2525
var (
2626
topicBranch string
@@ -29,7 +29,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
2929
forcePush bool
3030
)
3131

32-
results := make([]private.HockProcReceiveRefResult, 0, len(opts.OldCommitIDs))
32+
results := make([]private.HookProcReceiveRefResult, 0, len(opts.OldCommitIDs))
3333
repo := ctx.Repo.Repository
3434
gitRepo := ctx.Repo.GitRepo
3535
ownerName := ctx.Repo.Repository.OwnerName
@@ -40,7 +40,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
4040

4141
for i := range opts.OldCommitIDs {
4242
if opts.NewCommitIDs[i] == git.EmptySHA {
43-
results = append(results, private.HockProcReceiveRefResult{
43+
results = append(results, private.HookProcReceiveRefResult{
4444
OriginalRef: opts.RefFullNames[i],
4545
OldOID: opts.OldCommitIDs[i],
4646
NewOID: opts.NewCommitIDs[i],
@@ -50,7 +50,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
5050
}
5151

5252
if !strings.HasPrefix(opts.RefFullNames[i], git.PullRequestPrefix) {
53-
results = append(results, private.HockProcReceiveRefResult{
53+
results = append(results, private.HookProcReceiveRefResult{
5454
IsNotMatched: true,
5555
OriginalRef: opts.RefFullNames[i],
5656
})
@@ -71,7 +71,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
7171
}
7272

7373
if len(topicBranch) == 0 && len(curentTopicBranch) == 0 {
74-
results = append(results, private.HockProcReceiveRefResult{
74+
results = append(results, private.HookProcReceiveRefResult{
7575
OriginalRef: opts.RefFullNames[i],
7676
OldOID: opts.OldCommitIDs[i],
7777
NewOID: opts.NewCommitIDs[i],
@@ -166,7 +166,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
166166

167167
log.Trace("Pull request created: %d/%d", repo.ID, prIssue.ID)
168168

169-
results = append(results, private.HockProcReceiveRefResult{
169+
results = append(results, private.HookProcReceiveRefResult{
170170
Ref: pr.GetGitRefName(),
171171
OriginalRef: opts.RefFullNames[i],
172172
OldOID: git.EmptySHA,
@@ -194,7 +194,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
194194
}
195195

196196
if oldCommitID == opts.NewCommitIDs[i] {
197-
results = append(results, private.HockProcReceiveRefResult{
197+
results = append(results, private.HookProcReceiveRefResult{
198198
OriginalRef: opts.RefFullNames[i],
199199
OldOID: opts.OldCommitIDs[i],
200200
NewOID: opts.NewCommitIDs[i],
@@ -212,7 +212,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
212212
})
213213
return nil
214214
} else if len(output) > 0 {
215-
results = append(results, private.HockProcReceiveRefResult{
215+
results = append(results, private.HookProcReceiveRefResult{
216216
OriginalRef: oldCommitID,
217217
OldOID: opts.OldCommitIDs[i],
218218
NewOID: opts.NewCommitIDs[i],
@@ -255,7 +255,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat
255255
notification.NotifyPullRequestSynchronized(pusher, pr)
256256
isForcePush := comment != nil && comment.IsForcePush
257257

258-
results = append(results, private.HockProcReceiveRefResult{
258+
results = append(results, private.HookProcReceiveRefResult{
259259
OldOID: oldCommitID,
260260
NewOID: opts.NewCommitIDs[i],
261261
Ref: pr.GetGitRefName(),

0 commit comments

Comments
 (0)