8000 LibGit2Sharp: update to libgit2 v1.6.2 by ethomson · Pull Request #2015 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content

LibGit2Sharp: update to libgit2 v1.6.2 #2015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions LibGit2Sharp.Tests/GlobalSettingsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,17 @@ public void SetExtensions()
var extensions = GlobalSettings.GetExtensions();

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

// Disable "noop" extensions
GlobalSettings.SetExtensions("!noop");
extensions = GlobalSettings.GetExtensions();
Assert.Empty(extensions);
Assert.Equal(new[] { "objectformat" }, extensions);

// Enable two new extensions (it will reset the configuration and "noop" will be enabled)
GlobalSettings.SetExtensions("partialclone", "newext");
extensions = GlobalSettings.GetExtensions();
Assert.Equal(new[] { "noop", "partialclone", "newext" }, extensions);

// You can have multiple times the same extension
GlobalSettings.SetExtensions("noop", "test", "test" );
extensions = GlobalSettings.GetExtensions();
Assert.Equal(new[] { "noop", "noop", "test", "test" }, extensions);
Assert.Equal(new[] { "noop", "objectformat", "partialclone", "newext" }, extensions);
}
}
}
1 change: 1 addition & 0 deletions LibGit2Sharp/Core/GitFetchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal class GitFetchOptions
public bool UpdateFetchHead = true;
public TagFetchMode download_tags;
public GitProxyOptions ProxyOptions;
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
public GitStrArrayManaged CustomHeaders;
}
}
6 changes: 2 additions & 4 deletions LibGit2Sharp/Core/GitOdbBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ static GitOdbBackend()
public exists_prefix_callback ExistsPrefix;
public IntPtr Refresh;
public foreach_callback Foreach;

private IntPtr Padding; // TODO: add writemidx

public IntPtr Writepack;
public IntPtr WritePack;
public IntPtr WriteMidx;
public IntPtr Freshen;
public free_callback Free;

Expand Down
1 change: 1 addition & 0 deletions LibGit2Sharp/Core/GitPushOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ internal class GitPushOptions
public int PackbuilderDegreeOfParallelism;
public GitRemoteCallbacks RemoteCallbacks;
public GitProxyOptions ProxyOptions;
public RemoteRedirectMode FollowRedirects = RemoteRedirectMode.Auto;
public GitStrArrayManaged CustomHeaders;
}
}
2 changes: 2 additions & 0 deletions LibGit2Sharp/Core/GitWorktree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ internal class git_worktree_add_options
public int locked;

public IntPtr @ref = IntPtr.Zero;

public GitCheckoutOpts checkoutOpts = new GitCheckoutOpts { version = 1 };
}

[StructLayout(LayoutKind.Sequential)]
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.315-alpha.0.9]" PrivateAssets="none" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.318]" PrivateAssets="none" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.220" PrivateAssets="all" />
</ItemGroup>
Expand Down
28 changes: 28 additions & 0 deletions LibGit2Sharp/RemoteRedirectMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace LibGit2Sharp
{
/// <summary>
/// Remote redirection settings; wehther redirects to another
/// host are permitted. By default, git will follow a redirect
/// on the initial request (`/info/refs`) but not subsequent
/// requests.
/// </summary>
public enum RemoteRedirectMode
{
/// <summary>
/// Do not follow any off-site redirects at any stage of
/// the fetch or push.
/// </summary>
None = 0, // GIT_REMOTE_REDIRECT_NONE

/// <summary>
/// Allow off-site redirects only upon the initial
/// request. This is the default.
/// </summary>
Auto, // GIT_REMOTE_REDIRECT_INITIAL

/// <summary>
/// Allow redirects at any stage in the fetch or push.
/// </summary>
All // GIT_REMOTE_REDIRECT_ALL
Comment on lines +11 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethomson I believe this is wrong. According to https://github.com/libgit2/libgit2/blob/2f20fe8869d7a1df7c9b7a9e2939c1a20533c6dc/include/git2/remote.h#L49-L66:

GIT_REMOTE_REDIRECT_NONE = (1 << 0),
GIT_REMOTE_REDIRECT_INITIAL = (1 << 1),
GIT_REMOTE_REDIRECT_ALL = (1 << 2)

Which is 1 - 2 - 4 instead of 0 - 1 - 2.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bording Also FYI since you're the maintainer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it seems like that definition should match: #2027

}
}
0