2024-07-18 18:29:16 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace SourceGit.Models
|
2024-03-17 18:37:06 -07:00
|
|
|
|
{
|
2024-07-18 18:29:16 -07:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
public class Branch
|
|
|
|
|
{
|
2021-04-29 05:05:55 -07:00
|
|
|
|
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; }
|
2024-08-09 01:06:28 -07:00
|
|
|
|
public bool IsDetachedHead { get; set; }
|
2021-04-29 05:05:55 -07:00
|
|
|
|
public string Upstream { get; set; }
|
2024-07-18 18:29:16 -07:00
|
|
|
|
public BranchTrackStatus TrackStatus { get; set; }
|
2021-04-29 05:05:55 -07:00
|
|
|
|
public string Remote { get; set; }
|
2024-07-01 19:23:21 -07:00
|
|
|
|
|
|
|
|
|
public string FriendlyName => IsLocal ? Name : $"{Remote}/{Name}";
|
2021-04-29 05:05:55 -07:00
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|