Skip to content

Commit fc1e243

Browse files
committed
Update libgit2 to 9042693
libgit2/libgit2@9bbc8f3...9042693
1 parent 352f6c5 commit fc1e243

30 files changed

+362
-161
lines changed

LibGit2Sharp/Configuration.cs

+10
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>

LibGit2Sharp/Core/GitCheckoutOpts.cs

+1
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

+1-1
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

+7
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

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 update_fetchhead = true;
12+
public TagFetchMode download_tags;
13+
14+
public GitFetchOptions()
15+
{
16+
download_tags = TagFetchMode.Auto;
17+
}
18+
}
19+
}

LibGit2Sharp/Core/GitIndexEntry.cs

+1-1
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

+1-1
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
}

LibGit2Sharp/Core/GitMergeOpts.cs

+56-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ internal struct GitMergeOpts
3131
/// Flags for automerging content.
3232
/// </summary>
3333
public MergeFileFavor MergeFileFavorFlags;
34+
35+
public GitMergeFileFlags file_flags;
3436
}
3537

3638
/// <summary>
@@ -63,11 +65,11 @@ internal enum GitMergeAnalysis
6365
/// </summary>
6466
GIT_MERGE_ANALYSIS_FASTFORWARD = (1 << 2),
6567

66-
/**
67-
* The HEAD of the current repository is "unborn" and does not point to
68-
* a valid commit. No merge can be performed, but the caller may wish
69-
* to simply set HEAD to the target commit(s).
70-
*/
68+
/// <summary>
69+
/// The HEAD of the current repository is "unborn" and does not point to
70+
/// a valid commit. No merge can be performed, but the caller may wish
71+
/// to simply set HEAD to the target commit(s).
72+
/// </summary>
7173
GIT_MERGE_ANALYSIS_UNBORN = (1 << 3),
7274
}
7375

@@ -105,4 +107,53 @@ internal enum GitMergeTreeFlags
105107
/// </summary>
106108
GIT_MERGE_TREE_FIND_RENAMES = (1 << 0),
107109
}
110+
111+
[Flags]
112+
internal enum GitMergeFileFlags
113+
{
114+
/// <summary>
115+
/// Defaults
116+
/// </summary>
117+
GIT_MERGE_FILE_DEFAULT = 0,
118+
119+
/// <summary>
120+
/// Create standard conflicted merge files
121+
/// </summary>
122+
GIT_MERGE_FILE_STYLE_MERGE = (1 << 0),
123+
124+
/// <summary>
125+
/// Create diff3-style files
126+
/// </summary>
127+
GIT_MERGE_FILE_STYLE_DIFF3 = (1 << 1),
128+
129+
/// <summary>
130+
/// Condense non-alphanumeric regions for simplified diff file
131+
/// </summary>
132+
GIT_MERGE_FILE_SIMPLIFY_ALNUM = (1 << 2),
133+
134+
/// <summary>
135+
/// Ignore all whitespace
136+
/// </summary>
137+
GIT_MERGE_FILE_IGNORE_WHITESPACE = (1 << 3),
138+
139+
/// <summary>
140+
/// Ignore changes in amount of whitespace
141+
/// </summary>
142+
GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = (1 << 4),
143+
144+
/// <summary>
145+
/// Ignore whitespace at end of line
146+
/// </summary>
147+
GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5),
148+
149+
/// <summary>
150+
/// Use the "patience diff" algorithm
151+
/// </summary>
152+
GIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6),
153+
154+
/// <summary>
155+
/// Take extra time to find minimal diff
156+
/// </summary>
157+
GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
158+
}
108159
}

LibGit2Sharp/Core/GitOdbBackend.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public delegate int write_callback(
114114
IntPtr backend,
115115
ref GitOid oid,
116116
IntPtr data,
117-
UIntPtr len,
117+
Int64 len,
118118
GitObjectType type);
119119

120120
/// <summary>
@@ -130,7 +130,7 @@ public delegate int write_callback(
130130
public delegate int writestream_callback(
131131
out IntPtr stream_out,
132132
IntPtr backend,
133-
UIntPtr length,
133+
Int64 length,
134134
GitObjectType type);
135135

136136
/// <summary>

LibGit2Sharp/Core/GitOdbBackendStream.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ static GitOdbBackendStream()
2222
public GitOdbBackendStreamMode Mode;
2323
public IntPtr HashCtx;
2424

25-
public UIntPtr DeclaredSize;
26-
public UIntPtr ReceivedBytes;
25+
public Int64 DeclaredSize;
26+
public Int64 ReceivedBytes;
2727

2828
public read_callback Read;
2929
public write_callback Write;

LibGit2Sharp/Core/GitPushOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ internal class GitPushOptions
77
{
88
public int Version = 1;
99
public int PackbuilderDegreeOfParallelism;
10+
public GitRemoteCallbacks RemoteCallbacks;
1011
}
1112
}

LibGit2Sharp/Core/GitPushUpdate.cs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
namespace LibGit2Sharp.Core
5+
{
6+
[StructLayout(LayoutKind.Sequential)]
7+
internal class GitPushUpdate
8+
{
9+
IntPtr src_refname;
10+
IntPtr dst_refname;
11+
GitOid src;
12+
GitOid dst;
13+
}
14+
}

LibGit2Sharp/Core/GitRemoteCallbacks.cs

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ internal struct GitRemoteCallbacks
2929

3030
internal NativeMethods.push_update_reference_callback push_update_reference;
3131

32+
internal NativeMethods.push_negotiation_callback push_negotiation;
33+
34+
internal IntPtr transport;
35+
3236
internal IntPtr payload;
3337
}
3438
}

LibGit2Sharp/Core/GitSmartSubtransportRegistration.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ internal class GitSmartSubtransportRegistration
88
{
99
public IntPtr SubtransportCallback;
1010
public uint Rpc;
11+
public uint Param;
1112

1213
public delegate int create_callback(
1314
out IntPtr subtransport,
14-
IntPtr transport);
15+
IntPtr owner,
16+
IntPtr param);
1517
}
1618
}

LibGit2Sharp/Core/GitSubmoduleOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal struct GitSubmoduleOptions
99

1010
public GitCheckoutOpts CheckoutOptions;
1111

12-
public GitRemoteCallbacks RemoteCallbacks;
12+
public GitFetchOptions FetchOptions;
1313

1414
public CheckoutStrategy CloneCheckoutStrategy;
1515
}

LibGit2Sharp/Core/NativeMethods.cs

+39-14
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ internal static extern int git_config_delete_entry(
276276
ConfigurationSafeHandle cfg,
277277
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string name);
278278

279+
[DllImport(libgit2)]
280+
internal static extern int git_config_delete_multivar(
281+
ConfigurationSafeHandle cfg,
282+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string name,
283+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string regexp);
284+
279285
[DllImport(libgit2)]
280286
internal static extern int git_config_find_global(GitBuf global_config_path);
281287

@@ -746,7 +752,7 @@ internal static extern int git_note_remove(
746752

747753
[DllImport(libgit2)]
748754
internal static extern int git_note_default_ref(
749-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))] out string notes_ref,
755+
GitBuf notes_ref,
750756
RepositorySafeHandle repo);
751757

752758
internal delegate int git_note_foreach_cb(
@@ -781,7 +787,7 @@ internal static extern int git_odb_foreach(
781787
IntPtr payload);
782788

783789
[DllImport(libgit2)]
784-
internal static extern int git_odb_open_wstream(out OdbStreamSafeHandle stream, ObjectDatabaseSafeHandle odb, UIntPtr size, GitObjectType type);
790+
internal static extern int git_odb_open_wstream(out OdbStreamSafeHandle stream, ObjectDatabaseSafeHandle odb, Int64 size, GitObjectType type);
785791

786792
[DllImport(libgit2)]
787793
internal static extern void git_odb_free(IntPtr odb);
@@ -998,7 +1004,10 @@ internal static extern string git_refspec_src(
9981004
internal static extern int git_remote_autotag(RemoteSafeHandle remote);
9991005

10001006
[DllImport(libgit2)]
1001-
internal static extern int git_remote_connect(RemoteSafeHandle remote, GitDirection direction);
1007+
internal static extern int git_remote_connect(
1008+
RemoteSafeHandle remote,
1009+
GitDirection direction,
1010+
ref GitRemoteCallbacks callbacks);
10021011

10031012
[DllImport(libgit2)]
10041013
internal static extern int git_remote_create(
@@ -1035,6 +1044,7 @@ internal static extern int git_remote_delete(
10351044
internal static extern int git_remote_fetch(
10361045
RemoteSafeHandle remote,
10371046
ref GitStrArray refspecs,
1047+
GitFetchOptions fetch_opts,
10381048
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string log_message);
10391049

10401050
[DllImport(libgit2)]
@@ -1066,12 +1076,26 @@ internal static extern int git_remote_push(
10661076

10671077
[DllImport(libgit2)]
10681078
internal static extern int git_remote_set_url(
1069-
RemoteSafeHandle remote,
1079+
RepositorySafeHandle repo,
1080+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string remote,
1081+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
1082+
1083+
[DllImport(libgit2)]
1084+
internal static extern int git_remote_add_fetch(
1085+
RepositorySafeHandle repo,
1086+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string remote,
10701087
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
10711088

10721089
[DllImport(libgit2)]
10731090
internal static extern int git_remote_set_pushurl(
1074-
RemoteSafeHandle remote,
1091+
RepositorySafeHandle repo,
1092+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string remote,
1093+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
1094+
1095+
[DllImport(libgit2)]
1096+
internal static extern int git_remote_add_push(
1097+
RepositorySafeHandle repo,
1098+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string remote,
10751099
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
10761100

10771101
[DllImport(libgit2)]
@@ -1096,9 +1120,6 @@ internal static extern int git_remote_lookup(
10961120
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
10971121
internal static extern string git_remote_name(RemoteSafeHandle remote);
10981122

1099-
[DllImport(libgit2)]
1100-
internal static extern int git_remote_save(RemoteSafeHandle remote);
1101-
11021123
[DllImport(libgit2)]
11031124
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
11041125
internal static extern string git_remote_url(RemoteSafeHandle remote);
@@ -1108,12 +1129,10 @@ internal static extern int git_remote_lookup(
11081129
internal static extern string git_remote_pushurl(RemoteSafeHandle remote);
11091130

11101131
[DllImport(libgit2)]
1111-
internal static extern void git_remote_set_autotag(RemoteSafeHandle remote, TagFetchMode option);
1112-
1113-
[DllImport(libgit2)]
1114-
internal static extern int git_remote_set_callbacks(
1115-
RemoteSafeHandle remote,
1116-
ref GitRemoteCallbacks callbacks);
1132+
internal static extern void git_remote_set_autotag(
1133+
RepositorySafeHandle repo,
1134+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name,
1135+
TagFetchMode option);
11171136

11181137
internal delegate int remote_progress_callback(IntPtr str, int len, IntPtr data);
11191138

@@ -1125,6 +1144,12 @@ internal delegate int remote_update_tips_callback(
11251144
ref GitOid newId,
11261145
IntPtr data);
11271146

1147+
internal delegate int push_negotiation_callback(
1148+
IntPtr updates, // GitPushUpdate?
1149+
UIntPtr len,
1150+
IntPtr payload
1151+
);
1152+
11281153
internal delegate int push_update_reference_callback(
11291154
IntPtr refName,
11301155
IntPtr status,

0 commit comments

Comments
 (0)