X Tutup
Skip to content

Commit 526714c

Browse files
authored
Merge pull request cli#278 from vilmibm/pr-status-info
Print repo and user context for status commands
2 parents 8aa46ab + d7bf83a commit 526714c

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

command/issue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func issueStatus(cmd *cobra.Command, args []string) error {
175175

176176
out := colorableOut(cmd)
177177

178+
fmt.Fprintln(out, "")
179+
fmt.Fprintf(out, "Relevant issues in %s\n", ghrepo.FullName(baseRepo))
180+
fmt.Fprintln(out, "")
181+
178182
printHeader(out, "Issues assigned to you")
179183
if issuePayload.Assigned.TotalCount > 0 {
180184
printIssues(out, " ", issuePayload.Assigned.TotalCount, issuePayload.Assigned.Issues)

command/issue_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func TestIssueStatus_blankSlate(t *testing.T) {
5858
t.Errorf("error running command `issue status`: %v", err)
5959
}
6060

61-
expectedOutput := `Issues assigned to you
61+
expectedOutput := `
62+
Relevant issues in OWNER/REPO
63+
64+
Issues assigned to you
6265
There are no issues assigned to you
6366
6467
Issues mentioning you

command/pr.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ func prStatus(cmd *cobra.Command, args []string) error {
104104

105105
out := colorableOut(cmd)
106106

107+
fmt.Fprintln(out, "")
108+
fmt.Fprintf(out, "Relevant pull requests in %s\n", ghrepo.FullName(baseRepo))
109+
fmt.Fprintln(out, "")
110+
107111
printHeader(out, "Current branch")
108112
if prPayload.CurrentPR != nil {
109113
printPrs(out, 0, *prPayload.CurrentPR)

command/pr_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ func TestPRStatus_blankSlate(t *testing.T) {
136136
t.Errorf("error running command `pr status`: %v", err)
137137
}
138138

139-
expected := `Current branch
139+
expected := `
140+
Relevant pull requests in OWNER/REPO
141+
142+
Current branch
140143
There is no pull request associated with [blueberries]
141144
142145
Created by you

0 commit comments

Comments
 (0)
X Tutup