mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 10:50:52 +08:00
feature<SubTree>: just link subtree when prefix is already exists
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user