mirror of https://github.com/harness/drone.git
fix: [CODE-2583]: fix dry-running merge without merge method (#2852)
* fix: [CODE-2583]: fix dry-running merge without merge methodpull/3576/head
parent
32e817888a
commit
7b5490ac10
|
@ -102,9 +102,15 @@ func (c *Controller) Merge(
|
|||
pullreqNum int64,
|
||||
in *MergeInput,
|
||||
) (*types.MergeResponse, *types.MergeViolations, error) {
|
||||
// keep track of original method in case it's empty, as it is optional for dry-run.
|
||||
originalMergeMethod := in.Method
|
||||
if err := in.sanitize(); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if originalMergeMethod != "" {
|
||||
// use sanitized version if a non-empty merge method was provided.
|
||||
originalMergeMethod = in.Method
|
||||
}
|
||||
|
||||
requiredPermission := enum.PermissionRepoPush
|
||||
if in.DryRun {
|
||||
|
@ -212,7 +218,7 @@ func (c *Controller) Merge(
|
|||
SourceRepo: sourceRepo,
|
||||
PullReq: pr,
|
||||
Reviewers: reviewers,
|
||||
Method: in.Method,
|
||||
Method: originalMergeMethod,
|
||||
CheckResults: checkResults,
|
||||
CodeOwners: codeOwnerWithApproval,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue