fix: address verified review findings (branches-checkout-status-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:38:53 +02:00
1 parent 6e523d969d
commit 58f0fc4bf9
27 files changed
+281 -65

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ func TestPullViewResolvesCurrentBranch(t *testing.T) {
_, _ = fmt.Fprint(w, `[]`)
case r.URL.Path == "/api/v1/repos/alice/project/pulls":
require.Equal(t, "open", r.URL.Query().Get("state"))
_, _ = fmt.Fprint(w, `[{"number":9,"title":"Feature","html_url":"https://example.org/pr/9","state":"open","head":{"ref":"feature","sha":"abc"}}]`)
_, _ = fmt.Fprint(w, `[{"number":9,"title":"Feature","html_url":"https://example.org/pr/9","state":"open","head":{"ref":"feature","sha":"abc","repo":{"full_name":"alice/project"}}}]`)
default:
_, _ = fmt.Fprint(w, `[]`)
}
@@ -30,7 +30,7 @@ func TestPullViewResolvesCurrentBranch(t *testing.T) {
defer server.Close()
deps, out, _ := serverDeps(t, server.URL)
deps.Getenv = serverEnv(server.URL, map[string]string{"TEA_REPO": "alice/project"})
deps.Git = &fakeGit{results: map[string]string{"symbolic-ref --short HEAD": "feature"}}
deps.Git = &fakeGit{results: map[string]string{"symbolic-ref --quiet HEAD": "feature"}}
require.NoError(t, Execute(context.Background(), deps, []string{"pr", "view", "--json=number,title"}))
require.JSONEq(t, `{"number":9,"title":"Feature"}`, out.String())
deps.Git = &fakeGit{results: map[string]string{}}