microsoft / microsoft/VFSForGit
Better error message for corrupt .git/index
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 474
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
A user received this error when they had a bad index.
Information {"Message":"System.ArgumentOutOfRangeException: Non-negative number required.\r\nParameter name: dstOffset\r\n at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.ReadPath(GitIndexEntry indexEntryData, Int32 replaceIndex, Int32 byteCount)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.ParseIndex(ITracer tracer, Stream indexStream, GitIndexEntry resuableParsedIndexEntry, Func2 entryAction)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.RebuildProjection(ITracer tracer, Stream indexStream)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.BuildProjectionFromPath(ITracer tracer, String indexPath)\r\n at GVFS.RepairJobs.RepairJob.TryParseIndex(String path, List1 messages) in
Could it be more beneficial to run 'git ls-files' in and print out the error?
Can we handle this better?
@kewillford @wilbaker @jamill @derrickstolee for everyone's thoughts.
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
Start with GitIndexProjection.GitIndexParser.ReadPath and ParseIndex in the stack trace, then follow the call into RepairJob.TryParseIndex. Reproduce the corrupt-index case and inspect the existing diagnostic path; done means the failure produces a useful user-facing error rather than the reported ArgumentOutOfRangeException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100