Skip to content

Commit

Permalink
Apply Matthias Luescher patch trevorr#42 - 'Fix moving of empty direc…
Browse files Browse the repository at this point in the history
…tories'

Signed-off-by: Július Adam <[email protected]>
  • Loading branch information
abevoelker authored and JAD-SVK committed Jul 6, 2016
1 parent 7d90413 commit b576760
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Vss2Git/AbstractVcsWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ public void VcsExec(string args)
ExecuteUnless(startInfo, null);
}

public bool VcsExecUnless(string args, string unless)
{
var startInfo = GetStartInfo(args);
return ExecuteUnless(startInfo, unless);
}

public void Exec(string exe, string args)
{
var startInfo = GetStartInfo(exe, args);
Expand Down
5 changes: 4 additions & 1 deletion Vss2Git/GitWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ public override void RemoveEmptyDir(string path)

public override void Move(string sourcePath, string destPath)
{
VcsExec("mv -f -- " + QuoteRelativePath(sourcePath) + " " + QuoteRelativePath(destPath));
if (!VcsExecUnless("mv -f -- " + QuoteRelativePath(sourcePath) + " " + QuoteRelativePath(destPath), "source directory is empty"))
{
Directory.Move(sourcePath, destPath);
}
SetNeedsCommit();
}

Expand Down

0 comments on commit b576760

Please sign in to comment.