Skip to content

Commit 9d93fba

Browse files
committed
Update libgit2 to 65f6c1c
libgit2/libgit2@3f8d005...65f6c1c
1 parent 6a92ac9 commit 9d93fba

18 files changed

+38
-42
lines changed
-963 KB
Binary file not shown.
965 KB
Binary file not shown.
-730 KB
Binary file not shown.
731 KB
Binary file not shown.

LibGit2Sharp.Tests/FetchFixture.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,18 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
8080
TestRemoteInfo remoteInfo = TestRemoteInfo.TestRemoteInstance;
8181
var expectedFetchState = new ExpectedFetchState(remoteName);
8282

83-
// Add expected tags only as no branches are expected to be fetched
83+
// Add expected tags
8484
foreach (KeyValuePair<string, TestRemoteInfo.ExpectedTagInfo> kvp in remoteInfo.Tags)
8585
{
8686
expectedFetchState.AddExpectedTag(kvp.Key, ObjectId.Zero, kvp.Value);
8787
}
8888

89+
// Add expected branch objects
90+
foreach (KeyValuePair<string, ObjectId> kvp in remoteInfo.BranchTips)
91+
{
92+
expectedFetchState.AddExpectedBranch(kvp.Key, ObjectId.Zero, kvp.Value);
93+
}
94+
8995
// Perform the actual fetch
9096
repo.Network.Fetch(remote, new FetchOptions {
9197
TagFetchMode = TagFetchMode.All,
@@ -96,7 +102,7 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
96102
expectedFetchState.CheckUpdatedReferences(repo);
97103

98104
// Verify the reflog entries
99-
Assert.Equal(0, repo.Refs.Log(string.Format("refs/remotes/{0}/master", remoteName)).Count()); // Only tags are retrieved
105+
Assert.Equal(1, repo.Refs.Log(string.Format("refs/remotes/{0}/master", remoteName)).Count()); // Branches are also retrieved
100106
}
101107
}
102108

LibGit2Sharp.Tests/StatusFixture.cs

-15
Original file line numberDiff line numberDiff line change
@@ -401,21 +401,6 @@ public void RetrievingTheStatusOfTheRepositoryHonorsTheGitIgnoreDirectives()
401401
}
402402
}
403403

404-
[Fact]
405-
public void RetrievingTheStatusOfAnAmbiguousFileThrows()
406-
{
407-
string path = CloneStandardTestRepo();
408-
using (var repo = new Repository(path))
409-
{
410-
Touch(repo.Info.WorkingDirectory, "1/ambiguous1.txt", "I don't like brackets.");
411-
412-
string relativePath = Path.Combine("1", "ambiguous[1].txt");
413-
Touch(repo.Info.WorkingDirectory, relativePath, "Brackets all the way.");
414-
415-
Assert.Throws<AmbiguousSpecificationException>(() => repo.RetrieveStatus(relativePath));
416-
}
417-
}
418-
419404
[Theory]
420405
[InlineData(true, FileStatus.Unaltered, FileStatus.Unaltered)]
421406
[InlineData(false, FileStatus.Missing, FileStatus.Untracked)]

LibGit2Sharp/Core/NativeDllName.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace LibGit2Sharp.Core
22
{
33
internal static class NativeDllName
44
{
5-
public const string Name = "git2-3f8d005";
5+
public const string Name = "git2-65f6c1c";
66
}
77
}

LibGit2Sharp/Core/NativeMethods.cs

+10-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ private sealed class LibraryLifetimeObject : CriticalFinalizerObject
3030
[MethodImpl(MethodImplOptions.NoInlining)]
3131
public LibraryLifetimeObject()
3232
{
33-
Ensure.ZeroResult(git_threads_init());
33+
Ensure.ZeroResult(git_libgit2_init());
34+
// Ignore the error that this propagates. Call it in case openssl is being used.
35+
git_openssl_set_locking();
3436
AddHandle();
3537
}
3638

@@ -52,7 +54,7 @@ internal static void RemoveHandle()
5254
int count = Interlocked.Decrement(ref handlesCount);
5355
if (count == 0)
5456
{
55-
git_threads_shutdown();
57+
git_libgit2_shutdown();
5658
}
5759
}
5860

@@ -1087,7 +1089,7 @@ internal static extern int git_remote_is_valid_name(
10871089
internal static extern int git_remote_list(out GitStrArray array, RepositorySafeHandle repo);
10881090

10891091
[DllImport(libgit2)]
1090-
internal static extern int git_remote_load(
1092+
internal static extern int git_remote_lookup(
10911093
out RemoteSafeHandle remote,
10921094
RepositorySafeHandle repo,
10931095
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name);
@@ -1487,10 +1489,13 @@ internal static extern int git_tag_delete(
14871489
internal static extern GitObjectType git_tag_target_type(GitObjectSafeHandle tag);
14881490

14891491
[DllImport(libgit2)]
1490-
internal static extern int git_threads_init();
1492+
internal static extern int git_libgit2_init();
14911493

14921494
[DllImport(libgit2)]
1493-
internal static extern void git_threads_shutdown();
1495+
internal static extern void git_libgit2_shutdown();
1496+
1497+
[DllImport(libgit2)]
1498+
internal static extern int git_openssl_set_locking();
14941499

14951500
internal delegate void git_trace_cb(LogLevel level, IntPtr message);
14961501

LibGit2Sharp/Core/Proxy.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2099,12 +2099,12 @@ public static IEnumerable<DirectReference> git_remote_ls(Repository repository,
20992099
return refs;
21002100
}
21012101

2102-
public static RemoteSafeHandle git_remote_load(RepositorySafeHandle repo, string name, bool throwsIfNotFound)
2102+
public static RemoteSafeHandle git_remote_lookup(RepositorySafeHandle repo, string name, bool throwsIfNotFound)
21032103
{
21042104
using (ThreadAffinity())
21052105
{
21062106
RemoteSafeHandle handle;
2107-
int res = NativeMethods.git_remote_load(out handle, repo, name);
2107+
int res = NativeMethods.git_remote_lookup(out handle, repo, name);
21082108

21092109
if (res == (int)GitErrorCode.NotFound && !throwsIfNotFound)
21102110
{

LibGit2Sharp/Network.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public virtual IEnumerable<DirectReference> ListReferences(Remote remote, Creden
5252
{
5353
Ensure.ArgumentNotNull(remote, "remote");
5454

55-
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, remote.Name, true))
55+
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true))
5656
{
5757
if (credentialsProvider != null)
5858
{
@@ -129,7 +129,7 @@ public virtual void Fetch(Remote remote, FetchOptions options = null,
129129
{
130130
Ensure.ArgumentNotNull(remote, "remote");
131131

132-
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, remote.Name, true))
132+
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true))
133133
{
134134
DoFetch(remoteHandle, options, signature.OrDefault(repository.Config), logMessage);
135135
}
@@ -150,7 +150,7 @@ public virtual void Fetch(Remote remote, IEnumerable<string> refspecs, FetchOpti
150150
Ensure.ArgumentNotNull(remote, "remote");
151151
Ensure.ArgumentNotNull(refspecs, "refspecs");
152152

153-
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, remote.Name, true))
153+
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true))
154154
{
155155
Proxy.git_remote_set_fetch_refspecs(remoteHandle, refspecs);
156156

@@ -270,7 +270,7 @@ public virtual void Push(
270270
PushCallbacks pushStatusUpdates = new PushCallbacks(pushOptions.OnPushStatusError);
271271

272272
// Load the remote.
273-
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, remote.Name, true))
273+
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true))
274274
{
275275
var callbacks = new RemoteCallbacks(pushOptions.CredentialsProvider);
276276
GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks();

LibGit2Sharp/Remote.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public virtual IEnumerable<RefSpec> PushRefSpecs
8888
/// <returns>The transformed reference.</returns>
8989
internal string FetchSpecTransformToSource(string reference)
9090
{
91-
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, Name, true))
91+
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, Name, true))
9292
{
9393
GitRefSpecHandle fetchSpecPtr = Proxy.git_remote_get_refspec(remoteHandle, 0);
9494
return Proxy.git_refspec_rtransform(fetchSpecPtr, reference);

LibGit2Sharp/RemoteCollection.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ internal Remote RemoteForName(string name, bool shouldThrowIfNotFound = true)
4343
{
4444
Ensure.ArgumentNotNull(name, "name");
4545

46-
using (RemoteSafeHandle handle = Proxy.git_remote_load(repository.Handle, name, shouldThrowIfNotFound))
46+
using (RemoteSafeHandle handle = Proxy.git_remote_lookup(repository.Handle, name, shouldThrowIfNotFound))
4747
{
4848
return handle == null ? null : Remote.BuildFromPtr(handle, this.repository);
4949
}

LibGit2Sharp/RemoteUpdater.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal RemoteUpdater(Repository repo, Remote remote)
2828
fetchRefSpecs = new UpdatingCollection<string>(GetFetchRefSpecs, SetFetchRefSpecs);
2929
pushRefSpecs = new UpdatingCollection<string>(GetPushRefSpecs, SetPushRefSpecs);
3030

31-
remoteHandle = Proxy.git_remote_load(repo.Handle, remote.Name, true);
31+
remoteHandle = Proxy.git_remote_lookup(repo.Handle, remote.Name, true);
3232
}
3333

3434
private IEnumerable<string> GetFetchRefSpecs()

LibGit2Sharp/libgit2_hash.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3f8d005a82b39c504220d65b6a6aa696c3b1a9c4
1+
65f6c1c7eb7beb412e30cacd5cbb2b00e1e975b0

libgit2

Submodule libgit2 updated 69 files

nuget.package/build/LibGit2Sharp.props

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4-
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-3f8d005.dll">
5-
<Link>NativeBinaries\amd64\git2-3f8d005.dll</Link>
4+
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-65f6c1c.dll">
5+
<Link>NativeBinaries\amd64\git2-65f6c1c.dll</Link>
66
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
77
</None>
8-
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-3f8d005.pdb">
9-
<Link>NativeBinaries\amd64\git2-3f8d005.pdb</Link>
8+
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-65f6c1c.pdb">
9+
<Link>NativeBinaries\amd64\git2-65f6c1c.pdb</Link>
1010
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1111
</None>
12-
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-3f8d005.dll">
13-
<Link>NativeBinaries\x86\git2-3f8d005.dll</Link>
12+
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-65f6c1c.dll">
13+
<Link>NativeBinaries\x86\git2-65f6c1c.dll</Link>
1414
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1515
</None>
16-
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-3f8d005.pdb">
17-
<Link>NativeBinaries\x86\git2-3f8d005.pdb</Link>
16+
<None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\x86\git2-65f6c1c.pdb">
17+
<Link>NativeBinaries\x86\git2-65f6c1c.pdb</Link>
1818
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1919
</None>
2020
</ItemGroup>

0 commit comments

Comments
 (0)