Skip to content

Commit 70d62d5

Browse files
committed
LibGit2Sharp: update to libgit2 v1.6.2
1 parent 1af4954 commit 70d62d5

File tree

7 files changed

+38
-13
lines changed

7 files changed

+38
-13
lines changed

LibGit2Sharp.Tests/GlobalSettingsFixture.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,17 @@ public void SetExtensions()
9090
var extensions = GlobalSettings.GetExtensions();
9191

9292
// Assert that "noop" is supported by default
93-
Assert.Equal(new[] { "noop" }, extensions);
93+
Assert.Equal(new[] { "noop", "objectformat" }, extensions);
9494

9595
// Disable "noop" extensions
9696
GlobalSettings.SetExtensions("!noop");
9797
extensions = GlobalSettings.GetExtensions();
98-
Assert.Empty(extensions);
98+
Assert.Equal(new[] { "objectformat" }, extensions);
9999

100100
// Enable two new extensions (it will reset the configuration and "noop" will be enabled)
101101
GlobalSettings.SetExtensions("partialclone", "newext");
102102
extensions = GlobalSettings.GetExtensions();
103-
Assert.Equal(new[] { "noop", "partialclone", "newext" }, extensions);
104-
105-
// You can have multiple times the same extension
106-
GlobalSettings.SetExtensions("noop", "test", "test" );
107-
extensions = GlobalSettings.GetExtensions();
108-
Assert.Equal(new[] { "noop", "noop", "test", "test" }, extensions);
103+
Assert.Equal(new[] { "noop", "objectformat", "partialclone", "newext" }, extensions);
109104
}
110105
}
111106
}

LibGit2Sharp/Core/GitFetchOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal class GitFetchOptions
1111
public bool UpdateFetchHead = true;
1212
public TagFetchMode download_tags;
1313
public GitProxyOptions ProxyOptions;
14+
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
1415
public GitStrArrayManaged CustomHeaders;
1516
}
1617
}

LibGit2Sharp/Core/GitOdbBackend.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ static GitOdbBackend()
3333
public exists_prefix_callback ExistsPrefix;
3434
public IntPtr Refresh;
3535
public foreach_callback Foreach;
36-
37-
private IntPtr Padding; // TODO: add writemidx
38-
39-
public IntPtr Writepack;
36+
public IntPtr WritePack;
37+
public IntPtr WriteMidx;
4038
public IntPtr Freshen;
4139
public free_callback Free;
4240

LibGit2Sharp/Core/GitPushOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ internal class GitPushOptions
99
public int PackbuilderDegreeOfParallelism;
1010
public GitRemoteCallbacks RemoteCallbacks;
1111
public GitProxyOptions ProxyOptions;
12+
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
1213
public GitStrArrayManaged CustomHeaders;
1314
}
1415
}

LibGit2Sharp/Core/GitWorktree.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ internal class git_worktree_add_options
3737
public int locked;
3838

3939
public IntPtr @ref = IntPtr.Zero;
40+
41+
public GitCheckoutOpts checkoutOpts = new GitCheckoutOpts { version = 1 };
4042
}
4143

4244
[StructLayout(LayoutKind.Sequential)]

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</ItemGroup>
3131

3232
<ItemGroup>
33-
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.315-alpha.0.9]" PrivateAssets="none" />
33+
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.318]" PrivateAssets="none" />
3434
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
3535
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.220" PrivateAssets="all" />
3636
</ItemGroup>

LibGit2Sharp/RemoteRedirectMode.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace LibGit2Sharp
2+
{
3+
/// <summary>
4+
/// Remote redirection settings; wehther redirects to another
5+
/// host are permitted. By default, git will follow a redirect
6+
/// on the initial request (`/info/refs`) but not subsequent
7+
/// requests.
8+
/// </summary>
9+
public enum RemoteRedirectMode
10+
{
11+
/// <summary>
12+
/// Do not follow any off-site redirects at any stage of
13+
/// the fetch or push.
14+
/// </summary>
15+
None = 0, // GIT_REMOTE_REDIRECT_NONE
16+
17+
/// <summary>
18+
/// Allow off-site redirects only upon the initial
19+
/// request. This is the default.
20+
/// </summary>
21+
Auto, // GIT_REMOTE_REDIRECT_INITIAL
22+
23+
/// <summary>
24+
/// Allow redirects at any stage in the fetch or push.
25+
/// </summary>
26+
All // GIT_REMOTE_REDIRECT_ALL
27+
}
28+
}

0 commit comments

Comments
 (0)