8000 Update libgit2 to a56db99 · lofcz/libgit2sharp@62669ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 62669ec

Browse files
committed
Update libgit2 to a56db99
libgit2/libgit2@ff8d635...a56db99
1 parent b9ba915 commit 62669ec

File tree

6 files changed

+56
-5
lines changed

6 files changed

+56
-5
lines changed

LibGit2Sharp/Core/GitCredentialType.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,20 @@ internal enum GitCredentialType
3232
/// TODO
3333
/// </summary>
3434
SshInteractive = (1 << 4),
35+
36+
/// <summary>
37+
/// Username-only information
38+
///
39+
/// If the SSH transport does not know which username to use,
40+
/// it will ask via this credential type.
41+
/// </summary>
42+
Username = (1 << 5),
43+
44+
/// <summary>
45+
/// Credentials read from memory.
46+
///
47+
/// Only available for libssh2+OpenSSL for now.
48+
/// </summary>
49+
SshMemory = (1 << 6),
3550
}
3651
}

LibGit2Sharp/Core/GitDiff.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,33 @@ internal class GitDiffFindOptions
363363
// TODO
364364
public IntPtr SimilarityMetric;
365365
}
366+
367+
[Flags]
368+
enum GitDiffBinaryType
369+
{
370+
// There is no binary delta.
371+
GIT_DIFF_BINARY_NONE = 0,
372+
373+
// The binary data is the literal contents of the file. */
374+
GIT_DIFF_BINARY_LITERAL,
375+
376+
// The binary data is the delta from one side to the other. */
377+
GIT_DIFF_BINARY_DELTA,
378+
}
379+
380+
[StructLayout(LayoutKind.Sequential)]
381+
internal class GitDiffBinaryFile
382+
{
383+
public GitDiffBinaryType Type;
384+
public IntPtr Data;
385+
public UIntPtr DataLen;
386+
public UIntPtr InflatedLen;
387+
}
388+
389+
[StructLayout(LayoutKind.Sequential)]
390+
internal class GitDiffBinary
391+
{
392+
public GitDiffBinaryFile OldFile;
393+
public GitDiffBinaryFile NewFile;
394+
}
366395
}

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ internal delegate int git_diff_line_cb(
473473
[In] GitDiffLine line,
474474
IntPtr payload);
475475

476+
internal delegate int git_diff_binary_cb(
477+
[In] GitDiffDelta delta,
478+
[In] GitDiffBinary binary,
479+
IntPtr payload);
480+
476481
[DllImport(libgit2)]
477482
internal static extern int git_diff_blobs(
478483
GitObjectSafeHandle oldBlob,
@@ -481,6 +486,7 @@ internal static extern int git_diff_blobs(
481486
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictFilePathMarshaler))] FilePath new_as_path,
482487
GitDiffOptions options,
483488
git_diff_file_cb fileCallback,
489+
git_diff_binary_cb binaryCallback,
484490
git_diff_hunk_cb hunkCallback,
485491
git_diff_line_cb lineCallback,
486492
IntPtr payload);
@@ -489,6 +495,7 @@ internal static extern int git_diff_blobs(
489495
internal static extern int git_diff_foreach(
490496
DiffSafeHandle diff,
491497
git_diff_file_cb fileCallback,
498+
git_diff_binary_cb binaryCallback,
492499
git_diff_hunk_cb hunkCallback,
493500
git_diff_line_cb lineCallback,
494501
IntPtr payload);

LibGit2Sharp/Core/Proxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ public static void git_diff_blobs(
701701
{
702702
int res = NativeMethods.git_diff_blobs(
703703
osw1.ObjectPtr, null, osw2.ObjectPtr, null,
704-
options, fileCallback, hunkCallback, lineCallback, IntPtr.Zero);
704+
options, fileCallback, null, hunkCallback, lineCallback, IntPtr.Zero);
705705

706706
Ensure.ZeroResult(res);
707707
}
@@ -713,7 +713,7 @@ public static void git_diff_foreach(
713713
NativeMethods.git_diff_hunk_cb hunkCallback,
714714
NativeMethods.git_diff_line_cb lineCallback)
715715
{
716-
int res = NativeMethods.git_diff_foreach(diff, fileCallback, hunkCallback, lineCallback, IntPtr.Zero);
716+
int res = NativeMethods.git_diff_foreach(diff, fileCallback, null, hunkCallback, lineCallback, IntPtr.Zero);
717717
Ensure.ZeroResult(res);
718718
}
719719

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props')" />
3+
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -392,7 +392,7 @@
392392
<PropertyGroup>
393393
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
394394
</PropertyGroup>
395-
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props'))" />
395+
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props'))" />
396396
</Target>
397397
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
398398
Other similar extension points exist, see Microsoft.Common.targets.

LibGit2Sharp/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="LibGit2Sharp.NativeBinaries" version="1.0.51" targetFramework="net40" allowedVersions="[1.0.51]" />
3+
<package id="LibGit2Sharp.NativeBinaries" version="1.0.55" targetFramework="net40" allowedVersions="[1.0.55]" />
44
</packages>

0 commit comments

Comments
 (0)
0