Commands.Move throwing LibGit2Sharp.AmbiguousSpecificationException when renaming a folder
Reproduction steps
Use the "Commands.Move" function to rename a folder in a git repository.
Expected behavior
Folder is renamed in the git repository
Actual behavior
Getting unhandled exception when running:
Commands.Move(repo, "existing_folder_name", "desired_folder_name");
Exception: LibGit2Sharp.AmbiguousSpecificationException: 'More than one file matches the pathspec 'existing_foldere_name'. You can either force a literal path evaluation (GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH), or use git_status_foreach().'
Seems the problem is within the "Commands" class, function "BuildFrom", which calls "repository.RetrieveStatus(relativePath)".
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Windows 10 .NET Framework 4.6.1
// Push Got the same error and would really like to keep the file history. Otherwise I could just move them myself.
I am experiencing this as well. I had to resort to doing a move for individual files which takes a whole lot longer. When doing a rename of a folder in VS Code it is instant.
I am targeting net8 and using the net6 version of the nuget package.