diff --git a/internal/app/human_output.go b/internal/app/human_output.go index a153bfe3..92071082 100644 --- a/internal/app/human_output.go +++ b/internal/app/human_output.go @@ -162,8 +162,8 @@ func (a *application) printURL(cmd *cobra.Command, url string) error { return err } -// issueRef names an issue or pull request in feedback: "alice/x#5 (Fix login)". -func issueRef(repo string, number int64, title string) string { +// refLabel names an issue or pull request in feedback: "alice/x#5 (Fix login)". +func refLabel(repo string, number int64, title string) string { return fmt.Sprintf("%s#%d (%s)", repo, number, title) } diff --git a/internal/app/human_output_test.go b/internal/app/human_output_test.go index c77ae104..360b7cc4 100644 --- a/internal/app/human_output_test.go +++ b/internal/app/human_output_test.go @@ -363,7 +363,7 @@ func TestMutationFeedback(t *testing.T) { deps.Streams.OutTTY = tc.tty deps.Getenv = envFunc(map[string]string{"NO_COLOR": "1"}) a, cmd := outputApplication(deps, tc.json) - ref := issueRef("alice/x", 12, "Fix\x1b[2J login") + ref := refLabel("alice/x", 12, "Fix\x1b[2J login") a.done(cmd, "Created issue %s", ref) a.warn(cmd, "Issue %s is already closed", ref) require.NoError(t, a.printURL(cmd, "https://example.org/12")) @@ -387,7 +387,7 @@ func TestBatchDoneReportsEachSuccess(t *testing.T) { return listed{Number: n, Title: fmt.Sprintf("Issue %d", n)}, nil } label := func(n int64) string { return fmt.Sprintf("#%d", n) } - report := func(item listed) string { return "Closed issue " + issueRef("alice/x", item.Number, item.Title) } + report := func(item listed) string { return "Closed issue " + refLabel("alice/x", item.Number, item.Title) } for _, tc := range []struct { name, json, out, stderr string tty bool