mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
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:
9 files changed
+225
-16
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user