mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
48
src/Models/Repository.cs
Normal file
48
src/Models/Repository.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
#if NET48
|
||||
using Newtonsoft.Json;
|
||||
#else
|
||||
using System.Text.Json.Serialization;
|
||||
#endif
|
||||
|
||||
namespace SourceGit.Models {
|
||||
|
||||
/// <summary>
|
||||
/// 仓库
|
||||
/// </summary>
|
||||
public class Repository {
|
||||
|
||||
#region PROPERTIES_SAVED
|
||||
public string Name { get; set; } = "";
|
||||
public string Path { get; set; } = "";
|
||||
public string GitDir { get; set; } = "";
|
||||
public string GroupId { get; set; } = "";
|
||||
public int Bookmark { get; set; } = 0;
|
||||
public List<string> Filters { get; set; } = new List<string>();
|
||||
public List<string> CommitMessages { get; set; } = new List<string>();
|
||||
#endregion
|
||||
|
||||
#region PROPERTIES_RUNTIME
|
||||
[JsonIgnore] public List<Remote> Remotes = new List<Remote>();
|
||||
[JsonIgnore] public List<Branch> Branches = new List<Branch>();
|
||||
[JsonIgnore] public GitFlow GitFlow = new GitFlow();
|
||||
#endregion
|
||||
|
||||
public void PushCommitMessage(string message) {
|
||||
if (string.IsNullOrEmpty(message)) return;
|
||||
|
||||
int exists = CommitMessages.Count;
|
||||
if (exists > 0) {
|
||||
var last = CommitMessages[0];
|
||||
if (last == message) return;
|
||||
}
|
||||
|
||||
if (exists >= 10) {
|
||||
CommitMessages.RemoveRange(9, exists - 9);
|
||||
}
|
||||
|
||||
CommitMessages.Insert(0, message);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue