libgit2/libgit2sharp — comment on commit d526b188d7b18b5d4ed8da4c3e1fb3a1b954e470
File: LibGit2Sharp/Index.cs line 159
By Haacked:

The only assert I disagree with is:

Assert.Throws(() => repo.Index.Stage(new string[]
{ null }));

The way I think of it, `ArgumentNullException` is for when the argument to
the method itself is null. `ArgumentException` is for when the argument is
not null, but is somehow otherwise invalid. In this case, you could argue
that `Stage(IEnumerable)` passes each item to `Stage(T)` and that's
where the argument null exception happens, but I think it's cleaner and
more informative if the exception is thrown earlier at the public API call
site.

Now, I've been known to be lazy about this myself in my own application
code, but I do try really hard to be consistent in my library code. ;)

Phil

On Tue, Feb 28, 2012 at 11:49 AM, nulltoken <
reply@reply.github.com
> wrote:

> Of course, the `Unstage()` method would be updated accordingly...
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/libgit2/libgit2sharp/commit/d526b188d7b18b5d4ed8da4c3e1fb3a1b954e470#commitcomment-1022821
>