Merge remote-tracking branch 'origin/master' into pr-checkout

This commit is contained in:
Mislav Marohnić 2019-11-15 09:31:11 +01:00
commit 760fac906d
4 changed files with 26 additions and 5 deletions

View file

@ -209,10 +209,10 @@ func prList(cmd *cobra.Command, args []string) error {
case "MERGED":
prNum = utils.Magenta(prNum)
}
prBranch := utils.Cyan(truncate(branchWidth, pr.HeadRefName))
prBranch := utils.Cyan(truncate(branchWidth, pr.HeadLabel()))
fmt.Fprintf(out, "%s %-*s %s\n", prNum, titleWidth, truncate(titleWidth, pr.Title), prBranch)
} else {
fmt.Fprintf(out, "%d\t%s\t%s\n", pr.Number, pr.Title, pr.HeadRefName)
fmt.Fprintf(out, "%d\t%s\t%s\n", pr.Number, pr.Title, pr.HeadLabel())
}
}
return nil
@ -353,7 +353,7 @@ func prCheckout(cmd *cobra.Command, args []string) error {
func printPrs(prs ...api.PullRequest) {
for _, pr := range prs {
prNumber := fmt.Sprintf("#%d", pr.Number)
fmt.Printf(" %s %s %s", utils.Yellow(prNumber), truncate(50, pr.Title), utils.Cyan("["+pr.HeadRefName+"]"))
fmt.Printf(" %s %s %s", utils.Yellow(prNumber), truncate(50, pr.Title), utils.Cyan("["+pr.HeadLabel()+"]"))
checks := pr.ChecksStatus()
reviews := pr.ReviewStatus()

View file

@ -66,7 +66,7 @@ func TestPRList(t *testing.T) {
}
eq(t, out.String(), `32 New feature feature
29 Fixed bad bug bug-fix
29 Fixed bad bug hubot:bug-fix
28 Improve documentation docs
`)
}