mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +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
|
@ -1,5 +1,26 @@
|
|||
namespace SourceGit.Models
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class BranchTrackStatus
|
||||
{
|
||||
public List<string> Ahead { get; set; } = new List<string>();
|
||||
public List<string> Behind { get; set; } = new List<string>();
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Ahead.Count == 0 && Behind.Count == 0)
|
||||
return string.Empty;
|
||||
|
||||
var track = "";
|
||||
if (Ahead.Count > 0)
|
||||
track += $"{Ahead.Count}↑";
|
||||
if (Behind.Count > 0)
|
||||
track += $" {Behind.Count}↓";
|
||||
return track.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
public class Branch
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
@ -8,7 +29,7 @@
|
|||
public bool IsLocal { get; set; }
|
||||
public bool IsCurrent { get; set; }
|
||||
public string Upstream { get; set; }
|
||||
public string UpstreamTrackStatus { get; set; }
|
||||
public BranchTrackStatus TrackStatus { get; set; }
|
||||
public string Remote { get; set; }
|
||||
public bool IsHead { get; set; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue