Skip to content

Update libgit2 to a56db99 #1100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions LibGit2Sharp/Core/GitCredentialType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,20 @@ internal enum GitCredentialType
/// TODO
/// </summary>
SshInteractive = (1 << 4),

/// <summary>
/// Username-only information
///
/// If the SSH transport does not know which username to use,
/// it will ask via this credential type.
/// </summary>
Username = (1 << 5),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whyyyy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? As you know, I'm not very good at ssh-thingies

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant why add it? I can add the ssh-memory stuff in my PR, just don't want merge conflicts. :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. :D


/// <summary>
/// Credentials read from memory.
///
/// Only available for libssh2+OpenSSL for now.
/// </summary>
SshMemory = (1 << 6),
}
}
29 changes: 29 additions & 0 deletions LibGit2Sharp/Core/GitDiff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
7 changes: 7 additions & 0 deletions LibGit2Sharp/Core/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions LibGit2Sharp/Core/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions LibGit2Sharp/LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.51\build\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.55\build\LibGit2Sharp.NativeBinaries.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -392,7 +392,7 @@
<PropertyGroup>
<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>
</PropertyGroup>
<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'))" />
<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'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LibGit2Sharp.NativeBinaries" version="1.0.51" targetFramework="net40" allowedVersions="[1.0.51]" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.55" targetFramework="net40" allowedVersions="[1.0.55]" />
</packages>