Merge pull request #278 from vilmibm/pr-status-info

Print repo and user context for status commands
This commit is contained in:
Nate Smith 2020-01-30 14:06:21 -06:00 committed by GitHub
commit 526714cfd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -175,6 +175,10 @@ func issueStatus(cmd *cobra.Command, args []string) error {
out := colorableOut(cmd)
fmt.Fprintln(out, "")
fmt.Fprintf(out, "Relevant issues in %s\n", ghrepo.FullName(baseRepo))
fmt.Fprintln(out, "")
printHeader(out, "Issues assigned to you")
if issuePayload.Assigned.TotalCount > 0 {
printIssues(out, " ", issuePayload.Assigned.TotalCount, issuePayload.Assigned.Issues)

View file

@ -58,7 +58,10 @@ func TestIssueStatus_blankSlate(t *testing.T) {
t.Errorf("error running command `issue status`: %v", err)
}
expectedOutput := `Issues assigned to you
expectedOutput := `
Relevant issues in OWNER/REPO
Issues assigned to you
There are no issues assigned to you
Issues mentioning you

View file

@ -104,6 +104,10 @@ func prStatus(cmd *cobra.Command, args []string) error {
out := colorableOut(cmd)
fmt.Fprintln(out, "")
fmt.Fprintf(out, "Relevant pull requests in %s\n", ghrepo.FullName(baseRepo))
fmt.Fprintln(out, "")
printHeader(out, "Current branch")
if prPayload.CurrentPR != nil {
printPrs(out, 0, *prPayload.CurrentPR)

View file

@ -136,7 +136,10 @@ func TestPRStatus_blankSlate(t *testing.T) {
t.Errorf("error running command `pr status`: %v", err)
}
expected := `Current branch
expected := `
Relevant pull requests in OWNER/REPO
Current branch
There is no pull request associated with [blueberries]
Created by you