mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-23 01:36:57 -08:00
feature<SubTree>: just link subtree when prefix is already exists
This commit is contained in:
parent
93424a1117
commit
a9a76e7418
1 changed files with 4 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace SourceGit.Commands {
|
namespace SourceGit.Commands {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -17,6 +18,9 @@ namespace SourceGit.Commands {
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Add(string prefix, string source, string revision, bool squash, Action<string> onProgress) {
|
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;
|
handler = onProgress;
|
||||||
Args = $"subtree add --prefix=\"{prefix}\" {source} {revision}";
|
Args = $"subtree add --prefix=\"{prefix}\" {source} {revision}";
|
||||||
if (squash) Args += " --squash";
|
if (squash) Args += " --squash";
|
||||||
|
|
Loading…
Reference in a new issue