fix: address verified review findings (pulls-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:39:24 +02:00
1 parent 58f0fc4bf9
commit 401650b489
15 files changed
+202 -8

No files matched your search

+3 -1
View File
@@ -128,6 +128,8 @@ $ tea pr close 13 -c "Superseded by #15" --delete-branch`
// head branch of another open pull request, which deleting it would close.
func (a *application) deleteHead(cmd *cobra.Command, service services.Pulls, item services.Pull, merging, local bool) {
switch {
case item.Head == "":
// An AGit pull request has no head branch to delete.
case item.HeadRemoteDeleted && merging:
a.done(cmd, "Deleted remote branch %s", item.Head)
case item.HeadRemoteDeleted:
@@ -358,7 +360,7 @@ the base branch.`, Annotations: pullArgumentsAnnotation(map[string]string{"tea.c
} else {
a.done(cmd, "%s pull request %s", mergeVerbs[method], ref)
if deleteBranch {
a.deleteHead(cmd, service, merged, true, deleteLocal)
a.deleteHead(cmd, service, merged, !item.HeadRemoteDeleted, deleteLocal)
}
}
return a.jsonResult(cmd, merged)