mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
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; }
|
|
public string FullName { get; set; }
|
|
public string Head { get; set; }
|
|
public bool IsLocal { get; set; }
|
|
public bool IsCurrent { get; set; }
|
|
public string Upstream { get; set; }
|
|
public BranchTrackStatus TrackStatus { get; set; }
|
|
public string Remote { get; set; }
|
|
public bool IsHead { get; set; }
|
|
|
|
public string FriendlyName => IsLocal ? Name : $"{Remote}/{Name}";
|
|
}
|
|
}
|