mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
feature: add an indicator that shows those commits the current branch ahead/behind its upstream
This commit is contained in:
parent
9de2853003
commit
f0649c95b5
12 changed files with 180 additions and 194 deletions
|
@ -128,7 +128,7 @@ namespace SourceGit.Models
|
|||
_penCount = colors.Count;
|
||||
}
|
||||
|
||||
public static CommitGraph Parse(List<Commit> commits)
|
||||
public static CommitGraph Parse(List<Commit> commits, HashSet<string> canPushCommits, HashSet<string> canPullCommits)
|
||||
{
|
||||
double UNIT_WIDTH = 12;
|
||||
double HALF_WIDTH = 6;
|
||||
|
@ -148,6 +148,9 @@ namespace SourceGit.Models
|
|||
var isMerged = commit.IsMerged;
|
||||
var oldCount = unsolved.Count;
|
||||
|
||||
commit.CanPushToUpstream = canPushCommits.Remove(commit.SHA);
|
||||
commit.CanPullFromUpstream = !commit.CanPushToUpstream && canPullCommits.Remove(commit.SHA);
|
||||
|
||||
// Update current y offset
|
||||
offsetY += UNIT_HEIGHT;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue