mirror of
https://github.com/grdl/git-get.git
synced 2026-02-10 09:39:20 +00:00
Count commits ahead and behind the upstream branch
This commit is contained in:
@@ -67,14 +67,14 @@ func printBranchStatus(branch *git.BranchStatus) string {
|
||||
status = append(status, fmt.Sprintf(ColorYellow, git.StatusNoUpstream))
|
||||
}
|
||||
|
||||
if branch.NeedsPull {
|
||||
if branch.Behind != 0 {
|
||||
ok = false
|
||||
status = append(status, fmt.Sprintf(ColorYellow, git.StatusBehind))
|
||||
status = append(status, fmt.Sprintf(ColorYellow, fmt.Sprintf("%d %s", branch.Behind, git.StatusBehind)))
|
||||
}
|
||||
|
||||
if branch.NeedsPush {
|
||||
if branch.Ahead != 0 {
|
||||
ok = false
|
||||
status = append(status, fmt.Sprintf(ColorYellow, git.StatusAhead))
|
||||
status = append(status, fmt.Sprintf(ColorYellow, fmt.Sprintf("%d %s", branch.Ahead, git.StatusAhead)))
|
||||
}
|
||||
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user