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

+16
View File
@@ -245,3 +245,19 @@ func TestPullMergeRequiresNumberWithoutInteractive(t *testing.T) {
require.Error(t, err)
require.Contains(t, err.Error(), "pull request number")
}
func TestPullMergeReportsNoBranchDeletionForAGitPullRequests(t *testing.T) {
agit := `{"number":3,"title":"Add login","state":"open","base":{"ref":"main"},"head":{"ref":"refs/pull/3/head","label":"","sha":"abc123"}}`
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch {
case r.URL.Path == "/api/v1/repos/alice/project":
_, _ = w.Write([]byte(mergeRepository))
case r.Method == http.MethodGet:
_, _ = w.Write([]byte(agit))
}
}))
defer server.Close()
deps, _, diagnostics := serverDeps(t, server.URL)
require.NoError(t, Execute(context.Background(), deps, []string{"pr", "merge", "3", "-R", "alice/project", "--yes", "--delete-branch"}))
require.NotContains(t, diagnostics.String(), "emote branch")
}