8000 Update libgit2 to ff8d635 · odedw/libgit2sharp@6c12de4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c12de4

Browse files
committed
Update libgit2 to ff8d635
libgit2/libgit2@9bbc8f3...ff8d635
1 parent 56b908c commit 6c12de4

32 files changed

+370
-194
lines changed

LibGit2Sharp.Tests/FetchFixture.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ public void CanFetchCustomRefSpecsIntoAnEmptyRepository(string url, string local
134134
var expectedFetchState = new ExpectedFetchState(remoteName);
135135
expectedFetchState.AddExpectedBranch(localBranchName, ObjectId.Zero, remoteInfo.BranchTips[remoteBranchName]);
136136

137+
// Let's account for opportunistic updates during the Fetch() call
138+
if (!string.Equals("master", localBranchName, StringComparison.OrdinalIgnoreCase))
139+
{
140+
expectedFetchState.AddExpectedBranch("master", ObjectId.Zero, remoteInfo.BranchTips["master"]);
141+
}
142+
143+
if (string.Equals("master", localBranchName, StringComparison.OrdinalIgnoreCase)
144+
&& !string.Equals("master", remoteBranchName, StringComparison.OrdinalIgnoreCase))
145+
{
146+
expectedFetchState.AddExpectedBranch(remoteBranchName, ObjectId.Zero, remoteInfo.BranchTips[remoteBranchName]);
147+
}
148+
137149
// Perform the actual fetch
138150
repo.Network.Fetch(remote, new string[] { refSpec }, new FetchOptions {
139151
TagFetchMode = TagFetchMode.None,

LibGit2Sharp.Tests/RefSpecFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void SettingInvalidRefSpecsThrows(string refSpec)
183183
var remote = repo.Network.Remotes["origin"];
184184
var oldRefSpecs = remote.RefSpecs.Select(r => r.Specification).ToList();
185185

186-
Assert.Throws<LibGit2SharpException>(() =>
186+
Assert.Throws<InvalidSpecificationException>(() =>
187187
repo.Network.Remotes.Update(remote, r => r.FetchRefSpecs.Add(refSpec)));
188188

189189
var newRemote = repo.Network.Remotes["origin"];

LibGit2Sharp/Configuration.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ public virtual void Unset(string key, ConfigurationLevel level)
151151
}
152152
}
153153

154+
internal void UnsetMultivar(string key, ConfigurationLevel level)
155+
{
156+
Ensure.ArgumentNotNullOrEmptyString(key, "key");
157+
158+
using (ConfigurationSafeHandle h = RetrieveConfigurationHandle(level, true, configHandle))
159+
{
160+
Proxy.git_config_delete_multivar(h, key);
161+
}
162+
}
163+
154164
/// <summary>
155165
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
156166
/// </summary>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace LibGit2Sharp.Core
2+
{
3+
/// <summary>
4+
/// Specify how the remote tracking branches should be locally dealt with
5+
/// when their upstream countepart doesn't exist anymore.
6+
/// </summary>
7+
internal enum FetchPruneStrategy
8+
{
9+
/// <summary>
10+
/// Use the setting from the configuration
11+
/// or, when there isn't any, fallback to default behavior.
12+
/// </summary>
13+
FromConfigurationOrDefault = 0,
14+
15+
/// <summary>
16+
/// Force pruning on
17+
/// </summary>
18+
Prune,
19+
20+
/// <summary>
21+
/// Force pruning off
22+
/// </summary>
23+
NoPrune,
24+
}
25+
}

LibGit2Sharp/Core/GitCheckoutOpts.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ internal struct GitCheckoutOpts
158158
public GitStrArray paths;
159159

160160
public IntPtr baseline;
161+
public IntPtr baseline_index;
161162
public IntPtr target_directory;
162163

163164
public IntPtr ancestor_label;

LibGit2Sharp/Core/GitCloneOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal struct GitCloneOptions
1717
public uint Version;
1818

1919
public GitCheckoutOpts CheckoutOpts;
20-
public GitRemoteCallbacks RemoteCallbacks;
20+
public GitFetchOptions FetchOpts;
2121

2222
public int Bare;
2323
public GitCloneLocal Local;

LibGit2Sharp/Core/GitDiff.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ internal enum GitDiffOptionFlags
8080
/// </summary>
8181
GIT_DIFF_IGNORE_CASE = (1 << 10),
8282

83+
84+
/// <summary>
85+
/// May be combined with `GIT_DIFF_IGNORE_CASE` to specify that a file
86+
/// that has changed case will be returned as an add/delete pair.
87+
/// </summary>
88+
GIT_DIFF_INCLUDE_CASECHANGE = (1 << 11),
89+
8390
/// <summary>
8491
/// If the pathspec is set in the diff options, this flags means to
8592
/// apply it as an exact match instead of as an fnmatch pattern.

LibGit2Sharp/Core/GitFetchOptions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Runtime.InteropServices;
2+
3+
namespace LibGit2Sharp.Core
4+
{
5+
[StructLayout(LayoutKind.Sequential)]
6+
internal class GitFetchOptions
7+
{
8+
public int Version = 1;
9+
public GitRemoteCallbacks RemoteCallbacks;
10+
public FetchPruneStrategy Prune;
11+
public bool UpdateFetchHead = true;
12+
public TagFetchMode download_tags;
< D0E0 code>13+
}
14+
}

LibGit2Sharp/Core/GitIndexEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class GitIndexEntry
1515
public uint Mode;
1616
public uint Uid;
1717
public uint Gid;
18-
public Int64 file_size;
18+
public uint file_size;
1919
public GitOid Id;
2020
public ushort Flags;
2121
public ushort ExtendedFlags;

LibGit2Sharp/Core/GitIndexTime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace LibGit2Sharp.Core
55
[StructLayout(LayoutKind.Sequential)]
66
internal class GitIndexTime
77
{
8-
public long seconds;
8+
public int seconds;
99
public uint nanoseconds;
1010
}
1111
}

0 commit comments

Comments
 (0)
0