Skip to content

Commit 9eafc49

Browse files
lunny6543
andauthored
Apply suggestions from code review
Co-authored-by: 6543 <[email protected]>
1 parent 1b6c249 commit 9eafc49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/agit/agit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Repository, opts *private.HookOptions) ([]private.HookProcReceiveRefResult, error) {
2626
results := make([]private.HookProcReceiveRefResult, 0, len(opts.OldCommitIDs))
2727
topicBranch := opts.GitPushOptions["topic"]
28-
forcePushStr := opts.GitPushOptions["force-push"]
28+
forcePushStr, forcePushOK := opts.GitPushOptions["force-push"]
2929
var forcePush bool
30-
if forcePushStr == "" {
30+
if forcePushOK && forcePushStr == "" {
3131
forcePush = true
3232
} else {
3333
forcePush, _ = strconv.ParseBool(forcePushStr)

0 commit comments

Comments
 (0)