libgit2/libgit2sharp — pull request #540 by nulltoken (2014-08-27 12:24:00+00:00)
Title: git_foreach fails on Ensure.ZeroResult(res);

Action is performed under lock (single thread). It happens while deleting untracked files from working direcotry.

```
LibGit2Sharp.LibGit2SharpException was unhandled by user code
Message=An error was raised by libgit2. Category = Unknown (Error).
No error message has been provided by the native library
Source=LibGit2Sharp
StackTrace:
w LibGit2Sharp.Core.Ensure.HandleError(Int32 result) w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:wiersz 108
w LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:wiersz 126
w LibGit2Sharp.Core.Proxy.git_foreach[T1,T2,TResult](Func`3 resultSelector, Func`2 iterator, GitErrorCode[] ignoredErrorCodes) w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:wiersz 2380
w LibGit2Sharp.Core.Proxy.git_status_foreach[TResult](RepositorySafeHandle repo, Func`3 resultSelector) w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:wiersz 2017
w LibGit2Sharp.RepositoryStatus..ctor(Repository repo) w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\RepositoryStatus.cs:wiersz 53
w LibGit2Sharp.Index.RetrieveStatus() w D:\projekty\gitextensions\libgit2sharp\LibGit2Sharp\Index.cs:wiersz 505
w GitUI.ToolStripGitStatus.RunStatusCommand() w D:\projekty\gitextensions\GitUI\UserControls\ToolStripGitStatus.cs:wiersz 273
w GitCommands.AsyncLoader.<>c__DisplayClassd`1.b__c(CancellationToken token) w D:\projekty\gitextensions\GitCommands\AsyncLoader.cs:wiersz 85
w GitCommands.AsyncLoader.<>c__DisplayClass11`1.b__10() w D:\projekty\gitextensions\GitCommands\AsyncLoader.cs:wiersz 93
w System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)
w System.Threading.Tasks.Task.InnerInvoke()
w System.Threading.Tasks.Task.Execute()
InnerException:
```