diff --git a/src/Commands/SubTree.cs b/src/Commands/SubTree.cs index 6c963d09..62f632fe 100644 --- a/src/Commands/SubTree.cs +++ b/src/Commands/SubTree.cs @@ -1,4 +1,5 @@ using System; +using System.IO; namespace SourceGit.Commands { /// @@ -17,6 +18,9 @@ namespace SourceGit.Commands { } public bool Add(string prefix, string source, string revision, bool squash, Action 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";