【发布时间】:2017-06-26 14:36:44
【问题描述】:
有时会发生,当我的应用程序逐个文件复制git存储库文件夹时,当其他线程想要对存储库执行某些操作时,我会遇到这种异常,例如知道Head值.
异常是System.AccessViolationException,堆栈跟踪如下:
in LibGit2Sharp.Core.NativeMethods.git_reference_lookup(git_reference*& reference, git_repository* repo, String name)
in LibGit2Sharp.Core.Proxy.git_reference_lookup(RepositoryHandle repo, String name, Boolean shouldThrowIfNotFound) in c:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:riga 1932
in LibGit2Sharp.ReferenceCollection.Resolve[T](String name) in c:\projects\libgit2sharp\LibGit2Sharp\ReferenceCollection.cs:riga 441
in LibGit2Sharp.Repository.get_Head() in c:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:riga 268
in GitManager.get_CurrentBranch() in C:\Repository\MyProject\GitRepositoryManagement\GitManager.cs:riga 80
我不知道为什么会发生这种情况..任何帮助都非常感谢!!!谢谢。
【问题讨论】:
-
权限问题。就是那个文件吗?
-
@Will 您还需要哪些其他异常详细信息?
-
@SCramphorn 我不认为这是权限问题。如果我知道另一个线程没有做任何事情时复制整个文件夹,那么一切正常。
-
您使用的是什么版本的 LibGit2Sharp?能否请您升级到最新版本(v0.24),看看是否仍然存在?
-
@EdwardThomson 安装的 LibGit2Sharp 版本已经是 0.24.0
标签: c# git libgit2 libgit2sharp