Trying to clone a remote repository using LibGit2Sharp v.0.18.1.0 throws this exception:
LibGit2Sharp.LibGit2SharpException: Failed to mmap. Invalid handle value: The volume for a file has been externally altered so that the opened file is no longer valid.
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
Using the same url and workdir, I have successfully cloned the repository both using Git Bash and SourceTree. But for my task I need to do it programatically, and LibGit2Sharp seemed like a good choice.
Update: Somehow the error changed, now I get around 20KB of the remote repository and then this error:
A first chance exception of type 'System.AccessViolationException' occurred in LibGit2Sharp.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Update 2: The AccessViolationException was caused by a different cause (trying to clone with an emtpy string as remote url!)