fix: pr-closed-lookup (follow gh: find closed and merged pull requests by branch)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 18:57:43 +02:00
1 parent 9ce014bc75
commit 0db9ed463e
9 files changed
+225 -16

No files matched your search

+12 -6
View File
@@ -82,19 +82,25 @@ func refApplication(t *testing.T, gitResults map[string]string) (*application, s
]`)
}))
t.Cleanup(server.Close)
return refApplicationWith(t, server.URL, gitResults)
}
// refApplicationWith is refApplication for an existing server.
func refApplicationWith(t *testing.T, serverURL string, gitResults map[string]string) (*application, string) {
t.Helper()
deps, _, _ := testDeps(t)
deps.Getenv = serverEnv(server.URL, map[string]string{"TEA_REPO": "alice/project"})
deps.Getenv = serverEnv(serverURL, map[string]string{"TEA_REPO": "alice/project"})
results := map[string]string{
"remote get-url origin": server.URL + "/alice/project.git",
"remote get-url pulls/bob/project": server.URL + "/bob/project.git",
"remote get-url fork": server.URL + "/bob/project.git",
"remote get-url pulls/carol/project": server.URL + "/carol/project.git",
"remote get-url origin": serverURL + "/alice/project.git",
"remote get-url pulls/bob/project": serverURL + "/bob/project.git",
"remote get-url fork": serverURL + "/bob/project.git",
"remote get-url pulls/carol/project": serverURL + "/carol/project.git",
}
for key, value := range gitResults {
results[key] = value
}
deps.Git = &fakeGit{results: results}
return &application{deps: deps}, server.URL
return &application{deps: deps}, serverURL
}
func commandContext() *cobra.Command {