libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Internal ArgumentNullException during Repository.Reset

Open jasonmalinowski opened this issue 9 years ago • 1 comments

We have a tool that regularly runs on a repository to migrate changes between several different repositories. As a part of the process, we do a soft reset of a submodule, which periodically (around one time per week) fails with an ArgumentNullException:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: SafeHandle cannot be null.
    mscorlib.dll!System.StubHelpers.StubHelpers.SafeHandleAddRef(System.Runtime.InteropServices.SafeHandle pHandle, ref bool success) Line 1664
    LibGit2Sharp.dll!LibGit2Sharp.Core.Proxy.git_reset(LibGit2Sharp.Core.Handles.RepositorySafeHandle repo, LibGit2Sharp.ObjectId committishId, LibGit2Sharp.ResetMode resetKind, ref LibGit2Sharp.Core.GitCheckoutOpts checkoutOptions) Line 2615
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit, LibGit2Sharp.CheckoutOptions opts) Line 1002
    LibGit2Sharp.dll!LibGit2Sharp.Repository.Reset(LibGit2Sharp.ResetMode resetMode, LibGit2Sharp.Commit commit) Line 985

Unfortunately, I do not have a specific repo; every time this happens a rerun works properly again.

Version Consumed: 0.22. I'm not aware of this happening in an earlier version, but we had enough bugs in the tool itself that it's quite possible we never picked this up in the noise.

jasonmalinowski avatar May 25 '16 17:05 jasonmalinowski

@jasonmalinowski Have you experienced this issue recently? If not, might be worth closing this issue.

Rabadash8820 avatar Jun 30 '22 23:06 Rabadash8820