diff --git a/LibGit2Sharp/Core/GitCredentialType.cs b/LibGit2Sharp/Core/GitCredentialType.cs
index 00a7460d9..0ab1273e2 100644
--- a/LibGit2Sharp/Core/GitCredentialType.cs
+++ b/LibGit2Sharp/Core/GitCredentialType.cs
@@ -32,5 +32,20 @@ internal enum GitCredentialType
/// TODO
///
SshInteractive = (1 << 4),
+
+ ///
+ /// Username-only information
+ ///
+ /// If the SSH transport does not know which username to use,
+ /// it will ask via this credential type.
+ ///
+ Username = (1 << 5),
+
+ ///
+ /// Credentials read from memory.
+ ///
+ /// Only available for libssh2+OpenSSL for now.
+ ///
+ SshMemory = (1 << 6),
}
}
diff --git a/LibGit2Sharp/Core/GitDiff.cs b/LibGit2Sharp/Core/GitDiff.cs
index ab9f691db..4d1e9768f 100644
--- a/LibGit2Sharp/Core/GitDiff.cs
+++ b/LibGit2Sharp/Core/GitDiff.cs
@@ -363,4 +363,33 @@ internal class GitDiffFindOptions
// TODO
public IntPtr SimilarityMetric;
}
+
+ [Flags]
+ enum GitDiffBinaryType
+ {
+ // There is no binary delta.
+ GIT_DIFF_BINARY_NONE = 0,
+
+ // The binary data is the literal contents of the file. */
+ GIT_DIFF_BINARY_LITERAL,
+
+ // The binary data is the delta from one side to the other. */
+ GIT_DIFF_BINARY_DELTA,
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class GitDiffBinaryFile
+ {
+ public GitDiffBinaryType Type;
+ public IntPtr Data;
+ public UIntPtr DataLen;
+ public UIntPtr InflatedLen;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class GitDiffBinary
+ {
+ public GitDiffBinaryFile OldFile;
+ public GitDiffBinaryFile NewFile;
+ }
}
diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs
index 125822a4c..2590669bf 100644
--- a/LibGit2Sharp/Core/NativeMethods.cs
+++ b/LibGit2Sharp/Core/NativeMethods.cs
@@ -473,6 +473,11 @@ internal delegate int git_diff_line_cb(
[In] GitDiffLine line,
IntPtr payload);
+ internal delegate int git_diff_binary_cb(
+ [In] GitDiffDelta delta,
+ [In] GitDiffBinary binary,
+ IntPtr payload);
+
[DllImport(libgit2)]
internal static extern int git_diff_blobs(
GitObjectSafeHandle oldBlob,
@@ -481,6 +486,7 @@ internal static extern int git_diff_blobs(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictFilePathMarshaler))] FilePath new_as_path,
GitDiffOptions options,
git_diff_file_cb fileCallback,
+ git_diff_binary_cb binaryCallback,
git_diff_hunk_cb hunkCallback,
git_diff_line_cb lineCallback,
IntPtr payload);
@@ -489,6 +495,7 @@ internal static extern int git_diff_blobs(
internal static extern int git_diff_foreach(
DiffSafeHandle diff,
git_diff_file_cb fileCallback,
+ git_diff_binary_cb binaryCallback,
git_diff_hunk_cb hunkCallback,
git_diff_line_cb lineCallback,
IntPtr payload);
diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs
index 5a52f0660..c18c3bfec 100644
--- a/LibGit2Sharp/Core/Proxy.cs
+++ b/LibGit2Sharp/Core/Proxy.cs
@@ -701,7 +701,7 @@ public static void git_diff_blobs(
{
int res = NativeMethods.git_diff_blobs(
osw1.ObjectPtr, null, osw2.ObjectPtr, null,
- options, fileCallback, hunkCallback, lineCallback, IntPtr.Zero);
+ options, fileCallback, null, hunkCallback, lineCallback, IntPtr.Zero);
Ensure.ZeroResult(res);
}
@@ -713,7 +713,7 @@ public static void git_diff_foreach(
NativeMethods.git_diff_hunk_cb hunkCallback,
NativeMethods.git_diff_line_cb lineCallback)
{
- int res = NativeMethods.git_diff_foreach(diff, fileCallback, hunkCallback, lineCallback, IntPtr.Zero);
+ int res = NativeMethods.git_diff_foreach(diff, fileCallback, null, hunkCallback, lineCallback, IntPtr.Zero);
Ensure.ZeroResult(res);
}
diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj
index 721530932..1642d2ab1 100644
--- a/LibGit2Sharp/LibGit2Sharp.csproj
+++ b/LibGit2Sharp/LibGit2Sharp.csproj
@@ -1,6 +1,6 @@
-
+
Debug
AnyCPU
@@ -392,7 +392,7 @@
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}.
-
+