-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
First, thanks for this awesome tool. It saved a lot of time.
I'm trying to rename a project from something like src/SomeThing.Core to src/Something.Core. This is the command I'm running in a Powershell run as admin:
> renameproject.exe SomeThing.Core Something.Core --no-commit --no-paket --no-review
But, after running the above command, the renaming fails with the next output:
Analyzing references in your projects - depending on the number of projects this can take a bit...
Project `SomeThing.Core\SomeThing.Core.csproj` removed from the solution.
Rename from 'SomeThing.Core' to 'Something.Core/SomeThing.Core' failed. Should I try again? (y/n) n
fatal: renaming 'SomeThing.Core' failed: Permission denied
call 'git mv "C:\[redacted]\SomeThing\SomeThing.Core" "C:\[redacted]\SomeThing\Something.Core"' failed - aborting
...running git reset to undo any changes...
HEAD is now at f9dd0d3 Initial commitAfter googling a bit, I found this SO answer where a intermediate folder is used to move the src folder to destination. Like:
git mv src src-temp
git mv src-temp destChanging the gitMove method to follow that workaround seems to work. This is the gitMove method after the change:
void gitMove()
{
_filesystem.EnsureDirectoryExists(Path.GetDirectoryName(newDir));
var tmp = $"{oldDir}-Temp";
_git.Move(oldDir, tmp);
_git.Move(tmp, newDir);
var oldPath = Path.GetFileName(oldProjectPath).ToAbsolutePath(newDir);
if (oldPath != newProjectPath) _git.Move(oldPath, newProjectPath);
}I'm running Git 2.29.2.windows.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels