diff --git a/Lib/NativeBinaries/amd64/git2-47f3740.dll b/Lib/NativeBinaries/amd64/git2-47f3740.dll new file mode 100644 index 000000000..2546ad28a Binary files /dev/null and b/Lib/NativeBinaries/amd64/git2-47f3740.dll differ diff --git a/Lib/NativeBinaries/amd64/git2-9bbc8f3.pdb b/Lib/NativeBinaries/amd64/git2-47f3740.pdb similarity index 51% rename from Lib/NativeBinaries/amd64/git2-9bbc8f3.pdb rename to Lib/NativeBinaries/amd64/git2-47f3740.pdb index 43f4171fc..f196bae3f 100644 Binary files a/Lib/NativeBinaries/amd64/git2-9bbc8f3.pdb and b/Lib/NativeBinaries/amd64/git2-47f3740.pdb differ diff --git a/Lib/NativeBinaries/amd64/git2-9bbc8f3.dll b/Lib/NativeBinaries/amd64/git2-9bbc8f3.dll deleted file mode 100644 index f162e6c60..000000000 Binary files a/Lib/NativeBinaries/amd64/git2-9bbc8f3.dll and /dev/null differ diff --git a/Lib/NativeBinaries/x86/git2-47f3740.dll b/Lib/NativeBinaries/x86/git2-47f3740.dll new file mode 100644 index 000000000..6a9bccfc3 Binary files /dev/null and b/Lib/NativeBinaries/x86/git2-47f3740.dll differ diff --git a/Lib/NativeBinaries/x86/git2-9bbc8f3.pdb b/Lib/NativeBinaries/x86/git2-47f3740.pdb similarity index 52% rename from Lib/NativeBinaries/x86/git2-9bbc8f3.pdb rename to Lib/NativeBinaries/x86/git2-47f3740.pdb index 89c4624fc..252f00088 100644 Binary files a/Lib/NativeBinaries/x86/git2-9bbc8f3.pdb and b/Lib/NativeBinaries/x86/git2-47f3740.pdb differ diff --git a/Lib/NativeBinaries/x86/git2-9bbc8f3.dll b/Lib/NativeBinaries/x86/git2-9bbc8f3.dll deleted file mode 100644 index db04bb5b2..000000000 Binary files a/Lib/NativeBinaries/x86/git2-9bbc8f3.dll and /dev/null differ diff --git a/LibGit2Sharp/Core/GitMergeOpts.cs b/LibGit2Sharp/Core/GitMergeOpts.cs index a2ebe979d..7ed690fea 100644 --- a/LibGit2Sharp/Core/GitMergeOpts.cs +++ b/LibGit2Sharp/Core/GitMergeOpts.cs @@ -31,6 +31,11 @@ internal struct GitMergeOpts /// Flags for automerging content. /// public MergeFileFavor MergeFileFavorFlags; + + /// + /// Flags to use for file merging. + /// + public GitMergeFileFlags FileFlags; } /// @@ -105,4 +110,53 @@ internal enum GitMergeTreeFlags /// GIT_MERGE_TREE_FIND_RENAMES = (1 << 0), } + + [Flags] + internal enum GitMergeFileFlags + { + /// + /// No options. + /// + GIT_MERGE_FILE_DEFAULT = 0, + + /// + /// Creates standard conflicted merge files. + /// + GIT_MERGE_FILE_STYLE_MERGE = (1 << 0), + + /// + /// Creates diff3 style files. + /// + GIT_MERGE_FILE_STYLE_DIFF3 = (1 << 1), + + /// + /// Condenses non-alphanumeric regions for simplified diff files. + /// + GIT_MERGE_FILE_SIMPLIFY_ALNUM = (1 << 2), + + /// + /// Ignores all whitespace. + /// + GIT_MERGE_FILE_IGNORE_WHITESPACE = (1 << 3), + + /// + /// Ignores changes in amount of whitespace. + /// + GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = (1 << 4), + + /// + /// Ignores whitespace at the end of the line. + /// + GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5), + + /// + /// Uses the 'patience' diff algorithm. + /// + GIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6), + + /// + /// Take extra time to find the minimal diff. + /// + GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7), + } } diff --git a/LibGit2Sharp/Core/GitSmartSubtransportRegistration.cs b/LibGit2Sharp/Core/GitSmartSubtransportRegistration.cs index 724c6c414..b816cae9c 100644 --- a/LibGit2Sharp/Core/GitSmartSubtransportRegistration.cs +++ b/LibGit2Sharp/Core/GitSmartSubtransportRegistration.cs @@ -8,9 +8,11 @@ internal class GitSmartSubtransportRegistration { public IntPtr SubtransportCallback; public uint Rpc; + public IntPtr Param; public delegate int create_callback( out IntPtr subtransport, - IntPtr transport); + IntPtr transport, + IntPtr param); } } diff --git a/LibGit2Sharp/Core/NativeDllName.cs b/LibGit2Sharp/Core/NativeDllName.cs index 01f148a91..030d26b98 100644 --- a/LibGit2Sharp/Core/NativeDllName.cs +++ b/LibGit2Sharp/Core/NativeDllName.cs @@ -2,6 +2,6 @@ namespace LibGit2Sharp.Core { internal static class NativeDllName { - public const string Name = "git2-9bbc8f3"; + public const string Name = "git2-47f3740"; } } diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index a8fb1eacf..7d2f40bcd 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -726,7 +726,7 @@ internal static extern int git_note_remove( [DllImport(libgit2)] internal static extern int git_note_default_ref( - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))] out string notes_ref, + GitBuf buf, RepositorySafeHandle repo); internal delegate int git_note_foreach_cb( diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index ab2f7eadc..0bf7f0a3c 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -1298,12 +1298,12 @@ public static ObjectId git_note_create( public static string git_note_default_ref(RepositorySafeHandle repo) { using (ThreadAffinity()) + using (var buf = new GitBuf()) { - string notes_ref; - int res = NativeMethods.git_note_default_ref(out notes_ref, repo); + int res = NativeMethods.git_note_default_ref(buf, repo); Ensure.ZeroResult(res); - return notes_ref; + return LaxUtf8Marshaler.FromNative(buf.ptr); } } diff --git a/LibGit2Sharp/SmartSubtransportRegistration.cs b/LibGit2Sharp/SmartSubtransportRegistration.cs index df7c1cb4b..8247b023c 100644 --- a/LibGit2Sharp/SmartSubtransportRegistration.cs +++ b/LibGit2Sharp/SmartSubtransportRegistration.cs @@ -80,7 +80,8 @@ private static class EntryPoints private static int Subtransport( out IntPtr subtransport, - IntPtr transport) + IntPtr transport, + IntPtr payload) { subtransport = IntPtr.Zero; diff --git a/LibGit2Sharp/libgit2_hash.txt b/LibGit2Sharp/libgit2_hash.txt index 1f04184d9..8a5f941a5 100644 --- a/LibGit2Sharp/libgit2_hash.txt +++ b/LibGit2Sharp/libgit2_hash.txt @@ -1 +1 @@ -9bbc8f350b80a5a6e94651ec667cf9e5d545b317 +47f37400253210f483d84fb9c2ecf44fb5986849 diff --git a/libgit2 b/libgit2 index 9bbc8f350..47f374002 160000 --- a/libgit2 +++ b/libgit2 @@ -1 +1 @@ -Subproject commit 9bbc8f350b80a5a6e94651ec667cf9e5d545b317 +Subproject commit 47f37400253210f483d84fb9c2ecf44fb5986849 diff --git a/nuget.package/build/LibGit2Sharp.props b/nuget.package/build/LibGit2Sharp.props index b12792b74..d9d018563 100644 --- a/nuget.package/build/LibGit2Sharp.props +++ b/nuget.package/build/LibGit2Sharp.props @@ -1,20 +1,20 @@  - - NativeBinaries\amd64\git2-9bbc8f3.dll + + NativeBinaries\amd64\git2-47f3740.dll PreserveNewest - - NativeBinaries\amd64\git2-9bbc8f3.pdb + + NativeBinaries\amd64\git2-47f3740.pdb PreserveNewest - - NativeBinaries\x86\git2-9bbc8f3.dll + + NativeBinaries\x86\git2-47f3740.dll PreserveNewest - - NativeBinaries\x86\git2-9bbc8f3.pdb + + NativeBinaries\x86\git2-47f3740.pdb PreserveNewest