Skip to content

Commit 528edff

Browse files
committed
React to ABI changes
1 parent b05d86f commit 528edff

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

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 RemoteFollowRedirects FollowRedirects;
1415
public GitStrArrayManaged CustomHeaders;
1516
}
1617
}

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 RemoteFollowRedirects FollowRedirects;
1213
public GitStrArrayManaged CustomHeaders;
1314
}
1415
}

LibGit2Sharp/Core/GitStatusOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ internal class GitStatusOptions : IDisposable
1515

1616
public IntPtr Baseline = IntPtr.Zero;
1717

18+
public ushort RenameThreshold = 50;
19+
1820
public void Dispose()
1921
{
2022
PathSpec.Dispose();

LibGit2Sharp/Core/GitWorktree.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Runtime.InteropServices;
4-
using System.Text;
53

64
namespace LibGit2Sharp.Core
75
{
@@ -37,6 +35,8 @@ internal class git_worktree_add_options
3735
public int locked;
3836

3937
public IntPtr @ref = IntPtr.Zero;
38+
39+
public GitCheckoutOpts checkout_options;
4040
}
4141

4242
[StructLayout(LayoutKind.Sequential)]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace LibGit2Sharp.Core
2+
{
3+
internal enum RemoteFollowRedirects
4+
{
5+
Unspecified = 0,
6+
None = 1,
7+
Initial = 2,
8+
All = 4
9+
}
10+
}

LibGit2Sharp/WorktreeCollection.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
using LibGit2Sharp.Core;
2-
using LibGit2Sharp.Core.Handles;
3-
using System;
1+
using System;
42
using System.Collections;
53
using System.Collections.Generic;
64
using System.Globalization;
7-
using System.IO;
85
using System.Linq;
9-
using System.Text;
6+
using LibGit2Sharp.Core;
7+
using LibGit2Sharp.Core.Handles;
108

119
namespace LibGit2Sharp
1210
{
@@ -48,7 +46,7 @@ public virtual Worktree this[string name]
4846
}
4947

5048
/// <summary>
51-
///
49+
///
5250
/// </summary>
5351
/// <param name="committishOrBranchSpec"></param>
5452
/// <param name="name"></param>
@@ -57,7 +55,7 @@ public virtual Worktree this[string name]
5755
/// <returns></returns>
5856
public virtual Worktree Add(string committishOrBranchSpec, string name, string path, bool isLocked)
5957
{
60-
if(string.Equals(committishOrBranchSpec, name))
58+
if (string.Equals(committishOrBranchSpec, name))
6159
{
6260
// 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
6361
return null;
@@ -66,7 +64,8 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p
6664
git_worktree_add_options options = new git_worktree_add_options
6765
{
6866
version = 1,
69-
locked = Convert.ToInt32(isLocked)
67+
locked = Convert.ToInt32(isLocked),
68+
checkout_options = new GitCheckoutOpts { version = 1 }
7069
};
7170

7271
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
8382
}
8483
}
8584

86-
8785

88-
return this[name];
86+
87+
return this[name];
8988
}
9089

9190
/// <summary>
92-
///
91+
///
9392
/// </summary>
9493
/// <param name="name"></param>
9594
/// <param name="path"></param>
@@ -99,7 +98,8 @@ public virtual Worktree Add(string name, string path, bool isLocked)
9998
git_worktree_add_options options = new git_worktree_add_options
10099
{
101100
version = 1,
102-
locked = Convert.ToInt32(isLocked)
101+
locked = Convert.ToInt32(isLocked),
102+
checkout_options = new GitCheckoutOpts { version = 1 }
103103
};
104104

105105
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)
112112
}
113113

114114
/// <summary>
115-
///
115+
///
116116
/// </summary>
117117
/// <param name="worktree"></param>
118118
/// <returns></returns>
@@ -122,7 +122,7 @@ public virtual bool Prune(Worktree worktree)
122122
}
123123

124124
/// <summary>
125-
///
125+
///
126126
/// </summary>
127127
/// <param name="worktree"></param>
128128
/// <param name="ifLocked"></param>

0 commit comments

Comments
 (0)