libgit2 / libgit2/libgit2sharp
Throw when xxxOptions are null
Open
Nobody has claimed this yet.
Easy fix
Stabilization
Up for grabs
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
From https://github.com/libgit2/libgit2sharp/pull/1068/files#r31650592
We rely on the following pattern throughout the codebase.
public Things DoThings()
{
return DoThings(null);
}
public Things DoThings(ThingsOptions options)
{
options = options ?? new ThingsOptions();
[...]
}
Let's change this to the following one
public Things DoThings()
{
return DoThings(new ThingsOptions());
}
public Things DoThings(ThingsOptions options)
{
Ensure.ArgumentNotNull(options);
[...]
}
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
Search the C# codebase for overloads that accept xxxOptions and currently replace null with a new options instance. Review the referenced pull request discussion first, then identify every affected overload and its parameterless counterpart. Done means these overloads reject null options while parameterless calls construct the default options object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100