feature<SubTree>: just link subtree when prefix is already exists

This commit is contained in:
leo 2021-06-16 15:58:51 +08:00
parent 93424a1117
commit a9a76e7418

View file

@ -1,4 +1,5 @@
using System;
using System.IO;
namespace SourceGit.Commands {
/// <summary>
@ -17,6 +18,9 @@ namespace SourceGit.Commands {
}
public bool Add(string prefix, string source, string revision, bool squash, Action<string> onProgress) {
var path = Path.Combine(Cwd, prefix);
if (Directory.Exists(path)) return true;
handler = onProgress;
Args = $"subtree add --prefix=\"{prefix}\" {source} {revision}";
if (squash) Args += " --squash";