Add additions and deletions in pr view
This commit is contained in:
parent
2fbc037658
commit
9944698665
2 changed files with 10 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ type PullRequest struct {
|
|||
HeadRefName string
|
||||
Body string
|
||||
Mergeable string
|
||||
Additions int
|
||||
Deletions int
|
||||
MergeStateStatus string
|
||||
|
||||
Author struct {
|
||||
|
|
@ -571,6 +573,8 @@ func PullRequestByNumber(client *Client, repo ghrepo.Interface, number int) (*Pu
|
|||
closed
|
||||
body
|
||||
mergeable
|
||||
additions
|
||||
deletions
|
||||
author {
|
||||
login
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
|
|
@ -151,12 +152,16 @@ func printHumanPrPreview(opts *ViewOptions, pr *api.PullRequest) error {
|
|||
// Header (Title and State)
|
||||
fmt.Fprintln(out, cs.Bold(pr.Title))
|
||||
fmt.Fprintf(out,
|
||||
"%s • %s wants to merge %s into %s from %s\n",
|
||||
"%s • %s wants to merge %s into %s from %s • %s%s %s%s \n",
|
||||
shared.StateTitleWithColor(cs, *pr),
|
||||
pr.Author.Login,
|
||||
utils.Pluralize(pr.Commits.TotalCount, "commit"),
|
||||
pr.BaseRefName,
|
||||
pr.HeadRefName,
|
||||
cs.Green("+"),
|
||||
cs.Green(strconv.Itoa(pr.Additions)),
|
||||
cs.Red("-"),
|
||||
cs.Red(strconv.Itoa(pr.Deletions)),
|
||||
)
|
||||
|
||||
// Reactions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue