libgit2 / libgit2/libgit2sharp
LibGit2Sharp.LibGit2SharpException, additional info code and category changed to int
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
The following is taken from a log file:
LibGit2Sharp.LibGit2SharpException: Failed to map 'false?'
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositorySafeHandle repo, ObjectId treeId, GitCheckoutOpts& opts)
at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts)
at LibGit2Sharp.Repository.Checkout(Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec)
at LibGit2Sharp.Repository.Checkout(Branch branch, CheckoutOptions options)
Additional Data:
libgit2.code: -1
libgit2.category: 7
As you can see, both code and category are numbers here. But internally they are enums, it would be a lot easier to read this if the enums where used in the additional info, instead of the int.
LibGit2Sharp/LibGit2SharpException.cs
affected lines 58,59, where the enum is cast to int.
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
Open LibGit2Sharp/LibGit2SharpException.cs and inspect lines 58-59, where the libgit2 code and category enums are cast to int for additional information. Replace the numeric output with the corresponding enum values, then verify that exception data displays readable enum names instead of integers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100