mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Add Allow Maintainer Edits (#509)
close #508 Reviewed-on: https://gitea.com/gitea/tea/pulls/509 Reviewed-by: Norwin <noerw@noreply.gitea.io> Reviewed-by: strk <strk@noreply.gitea.io>
This commit is contained in:
		| @@ -14,7 +14,10 @@ import ( | ||||
|  | ||||
| // CreatePull interactively creates a PR | ||||
| func CreatePull(ctx *context.TeaContext) (err error) { | ||||
| 	var base, head string | ||||
| 	var ( | ||||
| 		base, head           string | ||||
| 		allowMaintainerEdits bool | ||||
| 	) | ||||
|  | ||||
| 	// owner, repo | ||||
| 	if ctx.Owner, ctx.Repo, err = promptRepoSlug(ctx.Owner, ctx.Repo); err != nil { | ||||
| @@ -49,6 +52,11 @@ func CreatePull(ctx *context.TeaContext) (err error) { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	promptC := &survey.Confirm{Message: "Allow Maintainers to push to the base branch", Default: true} | ||||
| 	if err := survey.AskOne(promptC, &allowMaintainerEdits); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	head = task.GetHeadSpec(headOwner, headBranch, ctx.Owner) | ||||
|  | ||||
| 	opts := gitea.CreateIssueOption{Title: task.GetDefaultPRTitle(head)} | ||||
| @@ -60,5 +68,6 @@ func CreatePull(ctx *context.TeaContext) (err error) { | ||||
| 		ctx, | ||||
| 		base, | ||||
| 		head, | ||||
| 		allowMaintainerEdits, | ||||
| 		&opts) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543