libgit2 / libgit2/libgit2sharp
Ensure.HandleError does not set GitErrorCategory.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction steps
This reproduces with any error handled by Ensure.HandleError, but my exact repro steps are:
- Clone repository
- Commit
- Push with credentials that have only read permissions to the repo.
Looking at the error message, the error appears to be thrown from here.
Expected behavior
Exception is thrown and the ex.Data["libgit2.category"] is set to a proper value. In my case it would be GitErrorCategory.Net.
Actual behavior
Exception is thrown, but the ex.Data["libgit2.category"] has value -1.
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Windows 10 1909; NET 4.6.1
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 in LibGit2Sharp/Core/Ensure.cs at Ensure.HandleError and compare the native error path named in libgit2's src/transports/winhttp.c. Reproduce the read-only push on Windows and inspect how the exception's ex.Data["libgit2.category"] is assigned. Done means this path reports GitErrorCategory.Net instead of -1.
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
- 45/100