mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(issue): name missing issues and attachments in errors
tea issue close 999 printed "issue 999: not found (HTTP 404 GET …)" and issue attachment view 1 9 blamed issue #1 for a missing attachment. Batch commands (issue close, reopen, edit, milestone issue add and remove) now report "issue 999: not found in alice/x", and attachment commands "attachment 9 not found in alice/x#1". Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
5 files changed
+64
-15
No files matched your search
@@ -59,11 +59,13 @@ $ tea milestone issue %[1]s v1.0 12 13 '#14'`, verb), Annotations: map[string]st
|
||||
return err
|
||||
}
|
||||
service := services.Issues{Client: target.client, Repository: target.Repo}
|
||||
results, failures := applyBatch(cmd, numbers, issueLabel, func(n int64) (services.Issue, error) {
|
||||
results, failures := applyBatch(cmd, numbers, issueLabel, func(n int64) (item services.Issue, err error) {
|
||||
if verb == "remove" {
|
||||
return service.RemoveMilestone(cmd.Context(), n, milestone)
|
||||
item, err = service.RemoveMilestone(cmd.Context(), n, milestone)
|
||||
} else {
|
||||
item, err = service.Edit(cmd.Context(), n, services.IssueEdit{Milestone: &milestone.ID})
|
||||
}
|
||||
return service.Edit(cmd.Context(), n, services.IssueEdit{Milestone: &milestone.ID})
|
||||
return item, itemError(err, target.Repo)
|
||||
}, func(services.Issue) {})
|
||||
if len(results) > 0 {
|
||||
changed := make([]string, len(results))
|
||||
|
||||
Reference in new issue
Block a user