Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit e310401

Browse files
committed
Honour ThreadAffinity in Proxy.git_odb_exists
1 parent 29c8603 commit e310401

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

LibGit2Sharp/Core/Proxy.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,12 +1367,15 @@ public static IntPtr git_odb_backend_malloc(IntPtr backend, UIntPtr len)
13671367

13681368
public static bool git_odb_exists(ObjectDatabaseSafeHandle odb, ObjectId id)
13691369
{
1370-
GitOid oid = id.Oid;
1370+
using (ThreadAffinity())
1371+
{
1372+
GitOid oid = id.Oid;
13711373

1372-
int res = NativeMethods.git_odb_exists(odb, ref oid);
1373-
Ensure.BooleanResult(res);
1374+
int res = NativeMethods.git_odb_exists(odb, ref oid);
1375+
Ensure.BooleanResult(res);
13741376

1375-
return (res == 1);
1377+
return (res == 1);
1378+
}
13761379
}
13771380

13781381
public static ICollection<TResult> git_odb_foreach<TResult>(

0 commit comments

Comments
 (0)