Skip to content

Commit 3de9707

Browse files
committed
fixup! Update libgit2 to ff8d635
1 parent 86e8ac3 commit 3de9707

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

LibGit2Sharp.Tests/FetchFixture.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ public void CanFetchCustomRefSpecsIntoAnEmptyRepository(string url, string local
135135
expectedFetchState.AddExpectedBranch(localBranchName, ObjectId.Zero, remoteInfo.BranchTips[remoteBranchName]);
136136

137137
// Let's account for opportunistic updates during the Fetch() call
138-
if (localBranchName != "master")
138+
if (!string.Equals("master", localBranchName, StringComparison.OrdinalIgnoreCase))
139139
{
140140
expectedFetchState.AddExpectedBranch("master", ObjectId.Zero, remoteInfo.BranchTips["master"]);
141141
}
142142

143-
if (localBranchName == "master" && remoteBranchName != "master")
143+
if (string.Equals("master", localBranchName, StringComparison.OrdinalIgnoreCase)
144+
&& !string.Equals("master", remoteBranchName, StringComparison.OrdinalIgnoreCase))
144145
{
145146
expectedFetchState.AddExpectedBranch(remoteBranchName, ObjectId.Zero, remoteInfo.BranchTips[remoteBranchName]);
146147
}

LibGit2Sharp/Core/FetchPruneStrategy.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ internal enum FetchPruneStrategy
88
{
99
/// <summary>
1010
/// Use the setting from the configuration
11+
/// or, when there isn't any, fallback to default behavior.
1112
/// </summary>
12-
Fallback = 0, // Default?
13+
FromConfigurationOrDefault = 0,
1314

1415
/// <summary>
1516
/// Force pruning on

LibGit2Sharp/Core/GitFetchOptions.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ internal class GitFetchOptions
77
{
88
public int Version = 1;
99
public GitRemoteCallbacks RemoteCallbacks;
10-
public FetchPruneStrategy prune;
11-
public bool update_fetchhead = true;
10+
public FetchPruneStrategy Prune;
11+
public bool UpdateFetchHead = true;
1212
public TagFetchMode download_tags;
13-
14-
public GitFetchOptions()
15-
{
16-
download_tags = TagFetchMode.Auto;
17-
}
1813
}
1914
}

LibGit2Sharp/Core/GitMergeOpts.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ internal struct GitMergeOpts
3232
/// </summary>
3333
public MergeFileFavor MergeFileFavorFlags;
3434

35-
public GitMergeFileFlags file_flags;
35+
/// <summary>
36+
/// File merging flags.
37+
/// </summary>
38+
public GitMergeFileFlags FileFlags;
3639
}
3740

3841
/// <summary>

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ internal static extern int git_commit_create_from_ids(
274274
[DllImport(libgit2)]
275275
internal static extern int git_config_delete_entry(
276276
ConfigurationSafeHandle cfg,
277-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string name);
277+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name);
278278

279279
[DllImport(libgit2)]
280280
internal static extern int git_config_delete_multivar(

LibGit2Sharp/Core/Proxy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,13 @@ public static bool git_config_delete(ConfigurationSafeHandle config, string name
472472
}
473473
}
474474

475+
const string anyValue = ".*";
476+
475477
public static bool git_config_delete_multivar(ConfigurationSafeHandle config, string name)
476478
{
477479
using (ThreadAffinity())
478480
{
479-
int res = NativeMethods.git_config_delete_multivar(config, name, ".*");
481+
int res = NativeMethods.git_config_delete_multivar(config, name, anyValue);
480482

481483
if (res == (int)GitErrorCode.NotFound)
482484
{

LibGit2Sharp/Network.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Diagnostics;
44
using System.Globalization;
55
using System.Linq;
6-
using System.Security.Policy;
76
using LibGit2Sharp.Core;
87
using LibGit2Sharp.Core.Handles;
98
using LibGit2Sharp.Handlers;
@@ -108,7 +107,7 @@ public virtual IEnumerable<DirectReference> ListReferences(string url)
108107
}
109108
}
110109

111-
static RemoteSafeHandle Build(RepositorySafeHandle repoHandle, Remote remote, string url)
110+
static RemoteSafeHandle BuildRemoteSafeHandle(RepositorySafeHandle repoHandle, Remote remote, string url)
112111
{
113112
Debug.Assert((remote == null) ^ (url == null));
114113

@@ -135,7 +134,7 @@ static void DoFetch(RepositorySafeHandle repoHandle, Remote remote, string url,
135134
options = new FetchOptions();
136135
}
137136

138-
using (RemoteSafeHandle remoteHandle = Build(repoHandle, remote, url))
137+
using (RemoteSafeHandle remoteHandle = BuildRemoteSafeHandle(repoHandle, remote, url))
139138
{
140139
var callbacks = new RemoteCallbacks(options);
141140
GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks();

LibGit2Sharp/TagFetchMode.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
public enum TagFetchMode
88
{
99
/// <summary>
10-
/// Use the setting from the configuration.
10+
/// Use the setting from the configuration
11+
/// or, when there isn't any, fallback to default behavior.
1112
/// </summary>
12-
Fallback = 0, // GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK
13-
14-
13+
FromConfigurationOrDefault = 0, // GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK
1514

1615
/// <summary>
1716
/// Will automatically retrieve tags that

0 commit comments

Comments
 (0)