mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor(issue,pr): trim help, restating comments and single-use helpers
Cut issue, pr, label, milestone and comment examples to at most three, drop doc comments that only restate the name, fold the comment and attachment argument lookups into one closure each, and inline label helpers with one caller. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
13 files changed
+57
-147
No files matched your search
@@ -220,8 +220,7 @@ $ tea pr create
|
||||
# Take the title and body from the commits, without questions
|
||||
$ tea pr create --fill
|
||||
|
||||
$ tea pr create -t "Add login" -b "Closes #1" -B develop -r carol -l enhancement
|
||||
$ tea pr create --draft --fill`
|
||||
$ tea pr create -t "Add login" -b "Closes #1" -B develop -r carol -l enhancement`
|
||||
return create
|
||||
}
|
||||
|
||||
@@ -316,13 +315,14 @@ func (a *application) createPullInteractively(cmd *cobra.Command, snapshot setti
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
selectables, err := (services.Pulls{Client: target.client, Repository: target.Repo}).CreateSelectables(cmd.Context())
|
||||
service := services.Pulls{Client: target.client, Repository: target.Repo}
|
||||
selectables, err := service.CreateSelectables(cmd.Context())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
baseOwner, _, _ := strings.Cut(target.Repo, "/")
|
||||
headOwner, headBranch := a.defaultPullHead(cmd.Context())
|
||||
template, err := (services.Pulls{Client: target.client, Repository: target.Repo}).Template(cmd.Context(), repo.DefaultBranch)
|
||||
template, err := service.Template(cmd.Context(), repo.DefaultBranch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -361,7 +361,7 @@ func (a *application) createPullInteractively(cmd *cobra.Command, snapshot setti
|
||||
if err := a.ensureHeadPublished(cmd, target, snapshot, options.Head); err != nil {
|
||||
return err
|
||||
}
|
||||
item, err := (services.Pulls{Client: target.client, Repository: target.Repo}).Create(cmd.Context(), options)
|
||||
item, err := service.Create(cmd.Context(), options)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user