microsoft / microsoft/VFSForGit
git-apply doesn't work in VFS4G if files are not hydrated
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 474
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
Copied from 924426 in the old Azure Repos backlog.
Steps to reproduce:
- Build a patch off any commit. Easiest way is to checkout a new branch off master in GVFS and make a change in a file, (e.g. Readme.md) then commit that change to a new branch. Generate the patch by running:
git format-patch master --stdout > test.patch - Clone a new enlistment of the GVFS repo to make sure all files are unhydrated.
- Apply the patch generated in (1) by running: git apply test.patch
Expected Behavior:
- The change to Readme.md is applied
Actual Behavior:
Git complains with "error: Readme.md: No such file or directory"
Note that using the --cached option for apply doesn't fix the problem since it does put the modifications in the index but then leaves the working directory with the previous file versions as unstaged changes. The patch will be successfully applied if you commit the changes in the index and then do a reset --hard.
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 issue in a fresh VFS4G/GVFS enlistment using the described branch, Readme.md change, test.patch, and git apply test.patch steps. Start by tracing how git apply handles an unhydrated Readme.md, then verify that applying the patch updates both the working directory and index without requiring a hard reset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100