microsoft / microsoft/VFSForGit
File/Directory change incorrectly reports conflict
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 474
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
VFS for Git is somehow changing the behavior of git merge when handling a directory->file change.
Here is a repro scenario:
$ git clone https://dev.azure.com/gvfs/ci/_git/ForTests ForTests-Git
$ cd ForTests-Git
$ git merge --no-ff origin/FunctionalTests_20200701_MergeConflict_FolderToFile
Removing Scripts/StopDevService.bat
Removing Scripts/StartDevService.bat
Removing Scripts/SetupDevService.bat
Adding Scripts
Merge made by the 'recursive' strategy.
Scripts | 1 +
Scripts/SetupDevService.bat | 4 ----
Scripts/StartDevService.bat | 4 ----
Scripts/StopDevService.bat | 4 ----
4 files changed, 1 insertion(+), 12 deletions(-)
create mode 100644 Scripts
delete mode 100644 Scripts/SetupDevService.bat
delete mode 100644 Scripts/StartDevService.bat
delete mode 100644 Scripts/StopDevService.bat
However, VFS for Git reports this as a conflict instead:
$ gvfs clone https://dev.azure.com/gvfs/ci/_git/ForTests ForTests-VFS
$ cd ForTests-VFS/src
$ git merge --no-ff origin/FunctionalTests_20200701_MergeConflict_FolderToFile
CONFLICT (directory/file): There is a directory with name Scripts in HEAD. Adding Scripts as Scripts~origin_FunctionalTests_20200701_MergeConflict_FolderToFile
Automatic merge failed; fix conflicts and then commit the result.
$ git status
On branch test
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Changes to be committed:
deleted: Scripts/SetupDevService.bat
deleted: Scripts/StartDevService.bat
deleted: Scripts/StopDevService.bat
Unmerged paths:
(use "git add <file>..." to mark resolution)
added by them: Scripts
Untracked files:
(use "git add <file>..." to include in what will be committed)
Scripts~origin_FunctionalTests_20200701_MergeConflict_FolderToFile
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the directory-to-file merge using the ForTests repository and compare a standard git clone with a VFS for Git clone. Start with the shown git merge commands and status output; done means the VFS case matches Git's successful merge behavior without reporting an unresolved conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100