8000 Update libgit2 binaries to 7dfc5c3 · rlazev/libgit2sharp@39c2ed2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 39c2ed2

Browse files
committed
Update libgit2 binaries to 7dfc5c3
libgit2/libgit2@16e6cee...7dfc5c3
1 parent 4d7c2ad commit 39c2ed2

20 files changed

+187
-170
lines changed

Lib/NativeBinaries/amd64/git2.dll

17 KB
Binary file not shown.

Lib/NativeBinaries/amd64/git2.pdb

32 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.dll

13.5 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.pdb

16 KB
Binary file not shown.

LibGit2Sharp/Core/GitCheckoutOpts.cs

Lines changed: 73 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,117 +3,129 @@
33

44
namespace LibGit2Sharp.Core
55
{
6-
internal delegate int conflict_cb(
7-
IntPtr conflicting_path,
8-
ref GitOid blob_oid,
9-
uint index_mode,
10-
uint wd_mode,
11-
IntPtr payload);
12-
13-
internal delegate void progress_cb(
14-
IntPtr strPtr,
15-
UIntPtr completed_steps,
16-
UIntPtr total_steps,
17-
IntPtr payload);
18-
19-
[StructLayout(LayoutKind.Sequential)]
20-
internal class GitCheckoutOpts
21-
{
22-
public uint version = 1;
23-
public CheckoutStrategy checkout_strategy;
24-
public int DisableFilters;
25-
public int DirMode;
26-
public int FileMode;
27-
public int FileOpenFlags;
28-
public conflict_cb conflictCb;
29-
public IntPtr ConflictPayload;
30-
public progress_cb ProgressCb;
31-
public IntPtr ProgressPayload;
32-
public UnSafeNativeMethods.git_strarray paths;
33-
}
34-
356
[Flags]
367
internal enum CheckoutStrategy
378
{
389
/// <summary>
3910
/// Default is a dry run, no actual updates.
4011
/// </summary>
41-
GIT_CHECKOUT_DEFAULT = 0,
12+
GIT_CHECKOUT_NONE = 0,
4213

4314
/// <summary>
44-
/// Allow update of entries where working dir matches HEAD.
45-
/// </summary>
46-
GIT_CHECKOUT_UPDATE_UNMODIFIED = (1 << 0),
47-
48-
/// <summary>
49-
/// Allow update of entries where working dir does not have file.
15+
/// Allow safe updates that cannot overwrite uncommited data.
5016
/// </summary>
51-
GIT_CHECKOUT_UPDATE_MISSING = (1 << 1),
17+
GIT_CHECKOUT_SAFE = (1 << 0),
5218

5319
/// <summary>
54-
/// Allow safe updates that cannot overwrite uncommited data.
20+
/// Allow safe updates plus creation of missing files.
5521
/// </summary>
56-
GIT_CHECKOUT_SAFE =
57-
(GIT_CHECKOUT_UPDATE_UNMODIFIED | GIT_CHECKOUT_UPDATE_MISSING),
22+
GIT_CHECKOUT_SAFE_CREATE = (1 << 1),
5823

5924
/// <summary>
6025
/// Allow update of entries in working dir that are modified from HEAD.
6126
/// </summary>
62-
GIT_CHECKOUT_UPDATE_MODIFIED = (1 << 2),
27+
GIT_CHECKOUT_FORCE = (1 << 2),
6328

6429
/// <summary>
65-
/// Update existing untracked files that are now present in the index.
30+
/// Allow checkout to make safe updates even if conflicts are found
6631
/// </summary>
67-
GIT_CHECKOUT_UPDATE_UNTRACKED = (1 << 3),
32+
GIT_CHECKOUT_ALLOW_CONFLICTS = (1 << 4),
6833

6934
/// <summary>
70-
/// Allow all updates to force working directory to look like index.
35+
/// Remove untracked files not in index (that are not ignored)
7136
/// </summary>
72-
GIT_CHECKOUT_FORCE =
73-
(GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_MODIFIED | GIT_CHECKOUT_UPDATE_UNTRACKED),
37+
GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 5),
7438

7539
/// <summary>
76-
/// Allow checkout to make updates even if conflicts are found.
40+
/// Remove ignored files not in index
7741
/// </summary>
78-
GIT_CHECKOUT_ALLOW_CONFLICTS = (1 << 4),
42+
GIT_CHECKOUT_REMOVE_IGNORED = (1 << 6),
7943

8044
/// <summary>
81-
/// Remove untracked files not in index (that are not ignored).
45+
/// Only update existing files, don't create new ones
8246
/// </summary>
83-
GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 5),
47+
GIT_CHECKOUT_UPDATE_ONLY = (1 << 7),
8448

8549
/// <summary>
86-
/// Only update existing files, don't create new ones.
50+
/// Normally checkout updates index entries as it goes; this stops that
8751
/// </summary>
88-
GIT_CHECKOUT_UPDATE_ONLY = (1 << 6),
89-
90-
/*
91-
* THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED.
92-
*/
52+
GIT_CHECKOUT_DONT_UPDATE_INDEX = (1 << 8),
9353

9454
/// <summary>
95-
/// Allow checkout to skip unmerged files (NOT IMPLEMENTED).
55+
/// Don't refresh index/config/etc before doing checkout
9656
/// </summary>
57+
GIT_CHECKOUT_NO_REFRESH = (1 << 9),
58+
59+
///Allow checkout to skip unmerged files (NOT IMPLEMENTED)
9760
GIT_CHECKOUT_SKIP_UNMERGED = (1 << 10),
9861

9962
/// <summary>
100-
/// For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED).
63+
/// For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED)
10164
/// </summary>
10265
GIT_CHECKOUT_USE_OURS = (1 << 11),
10366

10467
/// <summary>
105-
/// For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED).
68+
/// For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED)
10669
/// </summary>
10770
GIT_CHECKOUT_USE_THEIRS = (1 << 12),
10871

10972
/// <summary>
110-
/// Recursively checkout submodules with same options (NOT IMPLEMENTED).
73+
F987 /// Recursively checkout submodules with same options (NOT IMPLEMENTED)
11174
/// </summary>
11275
GIT_CHECKOUT_UPDATE_SUBMODULES = (1 << 16),
11376

11477
/// <summary>
115-
/// Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) */
78+
/// Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)
11679
/// </summary>
11780
GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1 << 17),
11881
}
82+
83+
[Flags]
84+
internal enum NotifyFlags
85+
{
86+
GIT_CHECKOUT_NOTIFY_NONE = 0,
87+
GIT_CHECKOUT_NOTIFY_CONFLICT = (1 << 0),
88+
GIT_CHECKOUT_NOTIFY_DIRTY = (1 << 1),
89+
GIT_CHECKOUT_NOTIFY_UPDATED = (1 << 2),
90+
GIT_CHECKOUT_NOTIFY_UNTRACKED = (1 << 3),
91+
GIT_CHECKOUT_NOTIFY_IGNORED = (1 << 4),
92+
}
93+
94+
internal delegate int checkout_notify_cb(
95+
NotifyFlags why,
96+
IntPtr path,
97+
IntPtr baseline,
98+
IntPtr target,
99+
IntPtr workdir,
100+
IntPtr payload);
101+
102+
internal delegate void progress_cb(
103+
IntPtr strPtr,
104+
UIntPtr completed_steps,
105+
UIntPtr total_steps,
106+
IntPtr payload);
107+
108+
[StructLayout(LayoutKind.Sequential)]
109+
internal struct GitCheckoutOpts
110+
{
111+
public uint version;
112+
113+
public CheckoutStrategy checkout_strategy;
114+
115+
public int DisableFilters;
116+
public uint DirMode;
117+
public uint FileMode;
118+
public int FileOpenFlags;
119+
120+
public NotifyFlags notify_flags;
121+
public checkout_notify_cb notify_cb;
122+
public IntPtr notify_payload;
123+
124+
public progress_cb progress_cb;
125+
public IntPtr progress_payload;
126+
127+
public UnSafeNativeMethods.git_strarray paths;
128+
129+
public IntPtr baseline;
130+
}
119131
}

LibGit2Sharp/Core/GitCloneOptions.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
namespace LibGit2Sharp.Core
5+
{
6+
[StructLayout(LayoutKind.Sequential)]
7+
internal class GitCloneOptions
8+
{
9+
public uint Version = 1;
10+
11+
public GitCheckoutOpts CheckoutOpts;
12+
public int Bare;
13+
public NativeMethods.git_transfer_progress_callback TransferProgressCallback;
14+
public IntPtr TransferProgressPayload;
15+
16+
public IntPtr RemoteName;
17+
public IntPtr PushUrl;
18+
public IntPtr FetchSpec;
19+
public IntPtr PushSpec;
20+
21+
public IntPtr CredAcquireCallback;
22+
public IntPtr CredAcquirePayload;
23+
24+
public IntPtr Transport;
25+
public GitRemoteCallbacks RemoteCallbacks;
26+
public int RemoteAutotag;
27+
}
28+
}

LibGit2Sharp/Core/GitOdbBackend.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ static GitOdbBackend()
1111
GCHandleOffset = Marshal.OffsetOf(typeof(GitOdbBackend), "GCHandle").ToInt32();
1212
}
1313

14+
public uint Version;
15+
1416
#pragma warning disable 169
1517

1618
/// <summary>

LibGit2Sharp/Core/GitRemoteCallbacks.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace LibGit2Sharp.Core
99
[StructLayout(LayoutKind.Sequential)]
1010
internal struct GitRemoteCallbacks
1111
{
12+
internal uint version;
13+
1214
internal NativeMethods.remote_progress_callback progress;
1315

1416
internal NativeMethods.remote_completion_callback completion;

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -150,35 +150,25 @@ internal static extern int git_branch_tracking(
150150
internal static extern int git_checkout_tree(
151151
RepositorySafeHandle repo,
152152
GitObjectSafeHandle treeish,
153-
GitCheckoutOpts opts);
153+
ref GitCheckoutOpts opts);
154154

155155
[DllImport(libgit2)]
156156
internal static extern int git_checkout_head(
157157
RepositorySafeHandle repo,
158-
GitCheckoutOpts opts);
158+
ref GitCheckoutOpts opts);
159159

160160
[DllImport(libgit2)]
161161
internal static extern int git_checkout_index(
162162
RepositorySafeHandle repo,
163-
IndexSafeHandle index,
164-
GitCheckoutOpts opts);
163+
GitObjectSafeHandle treeish,
164+
ref GitCheckoutOpts opts);
165165

166166
[DllImport(libgit2)]
167167
internal static extern int git_clone(
168168
out RepositorySafeHandle repo,
169169
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string origin_url,
170170
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath workdir_path,
171-
GitCheckoutOpts checkout_opts,
172-
git_transfer_progress_callback transfer_callback,
173-
IntPtr transfer_payload);
174-
175-
[DllImport(libgit2)]
176-
internal static extern int git_clone_bare(
177-
out RepositorySafeHandle repo,
178-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string url,
179-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath destination,
180-
git_transfer_progress_callback transfer_callback,
181-
IntPtr transfer_payload);
171+
GitCloneOptions opts);
182172

183173
[DllImport(libgit2)]
184174
internal static extern IntPtr git_commit_author(GitObjectSafeHandle commit);
@@ -322,7 +312,7 @@ internal static extern int git_diff_tree_to_tree(
322312
GitDiffOptions options);
323313

324314
[DllImport(libgit2)]
325-
internal static extern int git_diff_index_to_tree(
315+
internal static extern int git_diff_tree_to_index(
326316
out DiffListSafeHandle diff,
327317
RepositorySafeHandle repo,
328318
GitObjectSafeHandle oldTree,
@@ -335,14 +325,14 @@ internal static extern int git_diff_merge(
335325
DiffListSafeHandle from);
336326

337327
[DllImport(libgit2)]
338-
internal static extern int git_diff_workdir_to_index(
328+
internal static extern int git_diff_index_to_workdir(
339329
out DiffListSafeHandle diff,
340330
RepositorySafeHandle repo,
341331
IndexSafeHandle index,
342332
GitDiffOptions options);
343333

344334
[DllImport(libgit2)]
345-
internal static extern int git_diff_workdir_to_tree(
335+
internal static extern int git_diff_tree_to_workdir(
346336
out DiffListSafeHandle diff,
347337
RepositorySafeHandle repo,
348338
GitObjectSafeHandle oldTree,
@@ -462,7 +452,8 @@ internal static extern int git_note_create(
462452
SignatureSafeHandle committer,
463453
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string notes_ref,
464454
ref GitOid oid,
465-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string note);
455+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string note,
456+
int force);
466457

467458
[DllImport(libgit2)]
468459
internal static extern void git_note_free(IntPtr note);
@@ -625,20 +616,12 @@ internal static extern int git_remote_load(
625616
internal static extern string git_remote_name(RemoteSafeHandle remote);
626617

627618
[DllImport(libgit2)]
628-
internal static extern int git_remote_add(
619+
internal static extern int git_remote_create(
629620
out RemoteSafeHandle remote,
630621
RepositorySafeHandle repo,
631622
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name,
632623
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string url);
633624

634-
[DllImport(libgit2)]
635-
internal static extern int git_remote_new(
636-
out RemoteSafeHandle remote,
637-
RepositorySafeHandle repo,
638-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string name,
639-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string url,
640-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string fetchrefspec);
641-
642625
[DllImport(libgit2)]
643626
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))]
644627
internal static extern string git_remote_url(RemoteSafeHandle remote);
@@ -665,7 +648,12 @@ internal static extern int git_remote_download(
665648
internal static extern void git_remote_set_autotag(RemoteSafeHandle remote, TagFetchMode option);
666649

667650
[DllImport(libgit2)]
668-
internal static extern void git_remote_set_callbacks(
651+
internal static extern int git_remote_set_fetchspec(
652+
RemoteSafeHandle remote,
653+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Utf8Marshaler))] string fetchrefspec);
654+
655+
[DllImport(libgit2)]
656+
internal static extern int git_remote_set_callbacks(
669657
RemoteSafeHandle remote,
670658
ref GitRemoteCallbacks callbacks);
671659

0 commit comments

Comments
 (0)
0