diff --git a/LibGit2Sharp/Core/GitFetchOptions.cs b/LibGit2Sharp/Core/GitFetchOptions.cs index 3f0baa2c2..ec924cfe6 100644 --- a/LibGit2Sharp/Core/GitFetchOptions.cs +++ b/LibGit2Sharp/Core/GitFetchOptions.cs @@ -11,6 +11,7 @@ internal class GitFetchOptions public bool UpdateFetchHead = true; public TagFetchMode download_tags; public GitProxyOptions ProxyOptions; + public RemoteFollowRedirects FollowRedirects; public GitStrArrayManaged CustomHeaders; } } diff --git a/LibGit2Sharp/Core/GitPushOptions.cs b/LibGit2Sharp/Core/GitPushOptions.cs index f733534d2..a832a5f3d 100644 --- a/LibGit2Sharp/Core/GitPushOptions.cs +++ b/LibGit2Sharp/Core/GitPushOptions.cs @@ -9,6 +9,7 @@ internal class GitPushOptions public int PackbuilderDegreeOfParallelism; public GitRemoteCallbacks RemoteCallbacks; public GitProxyOptions ProxyOptions; + public RemoteFollowRedirects FollowRedirects; public GitStrArrayManaged CustomHeaders; } } diff --git a/LibGit2Sharp/Core/GitStatusOptions.cs b/LibGit2Sharp/Core/GitStatusOptions.cs index d577cefe6..d634fd20b 100644 --- a/LibGit2Sharp/Core/GitStatusOptions.cs +++ b/LibGit2Sharp/Core/GitStatusOptions.cs @@ -15,6 +15,8 @@ internal class GitStatusOptions : IDisposable public IntPtr Baseline = IntPtr.Zero; + public ushort RenameThreshold = 50; + public void Dispose() { PathSpec.Dispose(); diff --git a/LibGit2Sharp/Core/GitWorktree.cs b/LibGit2Sharp/Core/GitWorktree.cs index c71cb16c0..669038f68 100644 --- a/LibGit2Sharp/Core/GitWorktree.cs +++ b/LibGit2Sharp/Core/GitWorktree.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Runtime.InteropServices; -using System.Text; namespace LibGit2Sharp.Core { @@ -37,6 +35,8 @@ internal class git_worktree_add_options public int locked; public IntPtr @ref = IntPtr.Zero; + + public GitCheckoutOpts checkout_options; } [StructLayout(LayoutKind.Sequential)] diff --git a/LibGit2Sharp/Core/RemoteFollowRedirects.cs b/LibGit2Sharp/Core/RemoteFollowRedirects.cs new file mode 100644 index 000000000..387d41a75 --- /dev/null +++ b/LibGit2Sharp/Core/RemoteFollowRedirects.cs @@ -0,0 +1,10 @@ +namespace LibGit2Sharp.Core +{ + internal enum RemoteFollowRedirects + { + Unspecified = 0, + None = 1, + Initial = 2, + All = 4 + } +} diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 57c81cdfb..f710d993a 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -30,7 +30,7 @@ - + diff --git a/LibGit2Sharp/WorktreeCollection.cs b/LibGit2Sharp/WorktreeCollection.cs index 9822e882c..42d459b11 100644 --- a/LibGit2Sharp/WorktreeCollection.cs +++ b/LibGit2Sharp/WorktreeCollection.cs @@ -1,12 +1,10 @@ -using LibGit2Sharp.Core; -using LibGit2Sharp.Core.Handles; -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Linq; -using System.Text; +using LibGit2Sharp.Core; +using LibGit2Sharp.Core.Handles; namespace LibGit2Sharp { @@ -48,7 +46,7 @@ public virtual Worktree this[string name] } /// - /// + /// /// /// /// @@ -57,7 +55,7 @@ public virtual Worktree this[string name] /// public virtual Worktree Add(string committishOrBranchSpec, string name, string path, bool isLocked) { - if(string.Equals(committishOrBranchSpec, name)) + if (string.Equals(committishOrBranchSpec, name)) { // Proxy.git_worktree_add() creates a new branch of name = name, so if we want to checkout a given branch then the 'name' cannot be the same as the target branch return null; @@ -66,7 +64,8 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p git_worktree_add_options options = new git_worktree_add_options { version = 1, - locked = Convert.ToInt32(isLocked) + locked = Convert.ToInt32(isLocked), + checkout_options = new GitCheckoutOpts { version = 1 } }; using (var handle = Proxy.git_worktree_add(repo.Handle, name, path, options)) @@ -83,13 +82,13 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p } } - - return this[name]; + + return this[name]; } /// - /// + /// /// /// /// @@ -99,7 +98,8 @@ public virtual Worktree Add(string name, string path, bool isLocked) git_worktree_add_options options = new git_worktree_add_options { version = 1, - locked = Convert.ToInt32(isLocked) + locked = Convert.ToInt32(isLocked), + checkout_options = new GitCheckoutOpts { version = 1 } }; using (var handle = Proxy.git_worktree_add(repo.Handle, name, path, options)) @@ -112,7 +112,7 @@ public virtual Worktree Add(string name, string path, bool isLocked) } /// - /// + /// /// /// /// @@ -122,7 +122,7 @@ public virtual bool Prune(Worktree worktree) } /// - /// + /// /// /// ///