mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
feature<SubTree>: supports git subtree
feature
This commit is contained in:
parent
6b602e70c5
commit
130b5a66ab
22 changed files with 784 additions and 10 deletions
|
@ -19,6 +19,7 @@ namespace SourceGit.Models {
|
|||
public string GitDir { get; set; } = "";
|
||||
public string GroupId { get; set; } = "";
|
||||
public int Bookmark { get; set; } = 0;
|
||||
public List<SubTree> SubTrees { get; set; } = new List<SubTree>();
|
||||
public List<string> Filters { get; set; } = new List<string>();
|
||||
public List<string> CommitMessages { get; set; } = new List<string>();
|
||||
#endregion
|
||||
|
|
10
src/Models/SubTree.cs
Normal file
10
src/Models/SubTree.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
namespace SourceGit.Models {
|
||||
/// <summary>
|
||||
/// 子树
|
||||
/// </summary>
|
||||
public class SubTree {
|
||||
public string Prefix { get; set; }
|
||||
public string Remote { get; set; }
|
||||
public string Branch { get; set; } = "master";
|
||||
}
|
||||
}
|
|
@ -38,6 +38,10 @@ namespace SourceGit.Models {
|
|||
/// 子模块变更
|
||||
/// </summary>
|
||||
public event Action SubmoduleChanged;
|
||||
/// <summary>
|
||||
/// 树更新
|
||||
/// </summary>
|
||||
public event Action SubTreeChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 打开仓库事件
|
||||
|
@ -119,6 +123,13 @@ namespace SourceGit.Models {
|
|||
WorkingCopyChanged?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知更新子树列表
|
||||
/// </summary>
|
||||
public void RefreshSubTrees() {
|
||||
SubTreeChanged?.Invoke();
|
||||
}
|
||||
|
||||
private void Start(string repo, string gitDir) {
|
||||
wcWatcher = new FileSystemWatcher();
|
||||
wcWatcher.Path = repo;
|
||||
|
@ -163,6 +174,7 @@ namespace SourceGit.Models {
|
|||
TagChanged = null;
|
||||
StashChanged = null;
|
||||
SubmoduleChanged = null;
|
||||
SubTreeChanged = null;
|
||||
}
|
||||
|
||||
private void OnRepositoryChanged(object o, FileSystemEventArgs e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue