8000 Update libgit2 binaries to b641c00 · philhack/libgit2sharp@efb3ecc · GitHub
[go: up one dir, main page]

Skip to content

Commit efb3ecc

Browse files
yorahnulltoken
authored andcommitted
Update libgit2 binaries to b641c00
libgit2/libgit2@08283cb...b641c00
1 parent 92048f9 commit efb3ecc

File tree

13 files changed

+59
-33
lines changed

13 files changed

+59
-33
lines changed

Lib/NativeBinaries/amd64/git2.dll

33.5 KB
Binary file not shown.

Lib/NativeBinaries/amd64/git2.pdb

120 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.dll

26 KB
Binary file not shown.

Lib/NativeBinaries/x86/git2.pdb

88 KB
Binary file not shown.

LibGit2Sharp/Branch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private Branch ResolveTrackedBranch()
245245
return null;
246246
}
247247

248-
string trackedReferenceName = Proxy.git_branch_tracking_name(repo.Handle, CanonicalName);
248+
string trackedReferenceName = Proxy.git_branch_upstream_name(repo.Handle, CanonicalName);
249249

250250
if (trackedReferenceName == null)
251251
{

LibGit2Sharp/Core/GitDiff.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static GitStrArrayIn BuildFrom(FilePath[] paths)
126126

127127
for (int i = 0; i < nbOfPaths; i++)
128128
{
129-
var s = paths[i];
129+
var s = paths[i].Posix;
130130
pathPtrs[i] = FilePathMarshaler.FromManaged(s);
131131
}
132132

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ internal static extern int git_branch_remote_name(
176176
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string canonical_branch_name);
177177

178178
[DllImport(libgit2)]
179-
internal static extern int git_branch_tracking_name(
179+
internal static extern int git_branch_upstream_name(
180180
byte[] tracking_branch_name_out, // NB: This is more properly a StringBuilder, but it's UTF8
181181
UIntPtr buffer_size,
182182
RepositorySafeHandle repo,
@@ -415,6 +415,14 @@ internal static extern int git_diff_blobs(
415415
git_diff_data_cb lineCallback,
416416
IntPtr payload);
417417

418+
[DllImport(libgit2)]
419+
internal static extern int git_diff_foreach(
420+
DiffListSafeHandle diff,
421+
git_diff_file_cb fileCallback,
422+
git_diff_hunk_cb hunkCallback,
423+
git_diff_data_cb lineCallback,
424+
IntPtr payload);
425+
418426
[DllImport(libgit2)]
419427
internal static extern int git_graph_ahead_behind(out UIntPtr ahead, out UIntPtr behind, RepositorySafeHandle repo, ref GitOid one, ref GitOid two);
420428

@@ -771,6 +779,9 @@ internal static extern int git_remote_download(
771779
[DllImport(libgit2)]
772780
internal static extern void git_remote_free(IntPtr remote);
773781

782+
[DllImport(libgit2)]
783+
internal static extern GitRefSpecHandle git_remote_get_refspec(RemoteSafeHandle remote, UIntPtr n);
784+
774785
[DllImport(libgit2)]
775786
internal static extern int git_remote_is_valid_name(
776787
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string remote_name);
@@ -786,9 +797,6 @@ internal static extern int git_remote_load(
786797
[DllImport(libgit2)]
787798
internal static extern int git_remote_ls(RemoteSafeHandle remote, git_headlist_cb headlist_cb, IntPtr payload);
788799

789-
[DllImport(libgit2)]
790-
internal static extern GitRefSpecHandle git_remote_fetchspec(RemoteSafeHandle remote);
791-
792800
[DllImport(libgit2)]
793801
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8NoCleanupMarshaler))]
794802
internal static extern string git_remote_name(RemoteSafeHandle remote);
@@ -815,9 +823,9 @@ internal static extern int git_remote_set_callbacks(
815823
ref GitRemoteCallbacks callbacks);
816824

817825
[DllImport(libgit2)]
818-
internal static extern int git_remote_set_fetchspec(
826+
internal static extern int git_remote_add_fetch(
819827
RemoteSafeHandle remote,
820-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Utf8Marshaler))] string fetchrefspec);
828+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Utf8Marshaler))] string refspec);
821829

822830
internal delegate void remote_progress_callback(IntPtr str, int len, IntPtr data);
823831

LibGit2Sharp/Core/Proxy.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ public static string git_branch_remote_name(RepositorySafeHandle repo, string ca
162162
}
163163
}
164164

165-
public static string git_branch_tracking_name(RepositorySafeHandle handle, string canonicalReferenceName)
165+
public static string git_branch_upstream_name(RepositorySafeHandle handle, string canonicalReferenceName)
166166
{
167167
using (ThreadAffinity())
168168
{
169-
int bufSize = NativeMethods.git_branch_tracking_name(
169+
int bufSize = NativeMethods.git_branch_upstream_name(
170170
null, UIntPtr.Zero, handle, canonicalReferenceName);
171171

172172
if (bufSize == (int)GitErrorCode.NotFound)
@@ -178,7 +178,7 @@ public static string git_branch_tracking_name(RepositorySafeHandle handle, strin
178178

179179
var buffer = new byte[bufSize];
180180

181-
int res = NativeMethods.git_branch_tracking_name(
181+
int res = NativeMethods.git_branch_upstream_name(
182182
buffer, (UIntPtr)buffer.Length, handle, canonicalReferenceName);
183183
Ensure.Int32Result(res);
184184

@@ -511,6 +511,19 @@ public static void git_diff_blobs(
511511
}
512512
}
513513

514+
public static void git_diff_foreach(
515+
DiffListSafeHandle diff,
516+
NativeMethods.git_diff_file_cb fileCallback,
517+
NativeMethods.git_diff_hunk_cb hunkCallback,
518+
NativeMethods.git_diff_data_cb dataCallback)
519+
{
520+
using (ThreadAffinity())
521+
{
522+
int res = NativeMethods.git_diff_foreach(diff, fileCallback, hunkCallback, dataCallback, IntPtr.Zero);
523+
Ensure.ZeroResult(res);
524+
}
525+
}
526+
514527
public static DiffListSafeHandle git_diff_tree_to_index(
515528
RepositorySafeHandle repo,
516529
IndexSafeHandle index,
@@ -1385,9 +1398,9 @@ public static void git_remote_disconnect(RemoteSafeHandle remote)
13851398
}
13861399
}
13871400

1388-
public static GitRefSpecHandle git_remote_fetchspec(RemoteSafeHandle remote)
1401+
public static GitRefSpecHandle git_remote_get_refspec(RemoteSafeHandle remote, int n)
13891402
{
1390-
return NativeMethods.git_remote_fetchspec(remote);
1403+
return NativeMethods.git_remote_get_refspec(remote, (UIntPtr)n);
13911404
}
13921405

13931406
public static void git_remote_download(RemoteSafeHandle remote, TransferProgressHandler onTransferProgress)
@@ -1471,11 +1484,11 @@ public static void git_remote_set_autotag(RemoteSafeHandle remote, TagFetchMode
14711484
NativeMethods.git_remote_set_autotag(remote, value);
14721485
}
14731486

1474-
public static void git_remote_set_fetchspec(RemoteSafeHandle remote, string fetchspec)
1487+
public static void git_remote_add_fetch(RemoteSafeHandle remote, string refspec)
14751488
{
14761489
using (ThreadAffinity())
14771490
{
1478-
int res = NativeMethods.git_remote_set_fetchspec(remote, fetchspec);
1491+
int res = NativeMethods.git_remote_add_fetch(remote, refspec);
14791492
Ensure.ZeroResult(res);
14801493
}
14811494
}

LibGit2Sharp/Remote.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ internal string FetchSpecTransformToSource(string reference)
8282
{
8383
using (RemoteSafeHandle remoteHandle = Proxy.git_remote_load(repository.Handle, Name, true))
8484
{
85-
GitRefSpecHandle fetchSpecPtr = Proxy.git_remote_fetchspec(remoteHandle);
85+
GitRefSpecHandle fetchSpecPtr = Proxy.git_remote_get_refspec(remoteHandle, 0);
8686
return Proxy.git_refspec_rtransform(fetchSpecPtr, reference);
8787
}
8888
}

LibGit2Sharp/RemoteCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public virtual Remote Add(string name, string url, string fetchRefSpec)
103103

104104
using (RemoteSafeHandle handle = Proxy.git_remote_create(repository.Handle, name, url))
105105
{
106-
Proxy.git_remote_set_fetchspec(handle, fetchRefSpec);
106+
Proxy.git_remote_add_fetch(handle, fetchRefSpec);
107107
Proxy.git_remote_save(handle);
108108
return Remote.BuildFromPtr(handle, this.repository);
109109
}

LibGit2Sharp/TreeChanges.cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,32 @@ protected TreeChanges()
5050

5151
internal TreeChanges(DiffListSafeHandle diff)
5252
{
53+
Proxy.git_diff_foreach(diff, FileCallback, null, DataCallback);
5354
Proxy.git_diff_print_patch(diff, PrintCallBack);
5455
}
5556

56-
private int PrintCallBack(GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, UIntPtr contentlen, IntPtr payload)
57+
private int DataCallback(GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineOrigin, IntPtr content, UIntPtr contentLen, IntPtr payload)
5758
{
58-
string formattedoutput = Utf8Marshaler.FromNative(content, (int)contentlen);
59+
var filePath = FilePathMarshaler.FromNative(delta.NewFile.Path);
5960

60-
TreeEntryChanges currentChange = AddFileChange(delta, lineorigin);
61-
if (delta.Status == ChangeKind.Unmodified)
62-
{
63-
return 0;
64-
}
61+
AddLineChange(this[filePath], lineOrigin);
6562

66-
AddLineChange(currentChange, lineorigin);
63+
return 0;
64+
}
65+
66+
private int FileCallback(GitDiffDelta delta, float progress, IntPtr payload)
67+
{
68+
AddFileChange(delta);
69+
return 0;
70+
}
71+
72+
private int PrintCallBack(GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, UIntPtr contentlen, IntPtr payload)
73+
{
74+
string formattedoutput = Utf8Marshaler.FromNative(content, (int)contentlen);
75+
var filePath = FilePathMarshaler.FromNative(delta.NewFile.Path);
6776

68-
currentChange.AppendToPatch(formattedoutput);
6977
fullPatchBuilder.Append(formattedoutput);
78+
this[filePath].AppendToPatch(formattedoutput);
7079

7180
return 0;
7281
}
@@ - E8C6 87,13 +96,10 @@ private void AddLineChange(Changes currentChange, GitDiffLineOrigin lineOrigin)
8796
}
8897
}
8998

90-
private TreeEntryChanges AddFileChange(GitDiffDelta delta, GitDiffLineOrigin lineorigin)
99+
private void AddFileChange(GitDiffDelta delta)
91100
{
92101
var newFilePath = FilePathMarshaler.FromNative(delta.NewFile.Path);
93102

94-
if (lineorigin != GitDiffLineOrigin.GIT_DIFF_LINE_FILE_HDR)
95-
return this[newFilePath];
96-
97103
var oldFilePath = FilePathMarshaler.FromNative(delta.OldFile.Path);
98104
var newMode = (Mode)delta.NewFile.Mode;
99105
var oldMode = (Mode)delta.OldFile.Mode;
@@ -109,7 +115,6 @@ private TreeEntryChanges AddFileChange(GitDiffDelta delta, GitDiffLineOrigin lin
109115

110116
fileDispatcher[delta.Status](this, diffFile);
111117
changes.Add(newFilePath, diffFile);
112-
return diffFile;
113118
}
114119

115120
#region IEnumerable<Tag> Members

LibGit2Sharp/libgit2_hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
08283cbdb857d09f8e623c5c23abcaa499b6b3fc
1+
b641c00eebb3c60e8719c0dfc55dde91ca30a5d2

libgit2

Submodule libgit2 updated 610 files

0 commit comments

Comments
 (0)
0