diff options
Diffstat (limited to 'LibGit2Sharp')
-rw-r--r-- | LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs | 9 | ||||
-rw-r--r-- | LibGit2Sharp/Core/NativeDllName.cs | 7 | ||||
-rw-r--r-- | LibGit2Sharp/Core/NativeMethods.cs | 3 | ||||
-rw-r--r-- | LibGit2Sharp/Core/Proxy.cs | 7 | ||||
-rw-r--r-- | LibGit2Sharp/Core/UnSafeNativeMethods.cs | 4 | ||||
-rw-r--r-- | LibGit2Sharp/LibGit2Sharp.csproj | 1 | ||||
-rw-r--r-- | LibGit2Sharp/ReferenceCollection.cs | 4 | ||||
-rw-r--r-- | LibGit2Sharp/libgit2_hash.txt | 2 | ||||
-rw-r--r-- | LibGit2Sharp/libgit2sharp_hash.txt | 2 |
9 files changed, 27 insertions, 12 deletions
diff --git a/LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs b/LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs index 9a222a48..673b2187 100644 --- a/LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs +++ b/LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs @@ -1,3 +1,4 @@ +using System; using System.Runtime.InteropServices; namespace LibGit2Sharp.Core.Handles @@ -6,6 +7,14 @@ namespace LibGit2Sharp.Core.Handles { public GitError MarshalAsGitError() { + // Required on Mono < 3.0.8 + // https://bugzilla.xamarin.com/show_bug.cgi?id=11417 + // https://github.com/mono/mono/commit/9cdddca7ec283f3b9181f3f69c1acecc0d9cc289 + if (handle == IntPtr.Zero) + { + return null; + } + return (GitError)Marshal.PtrToStructure(handle, typeof(GitError)); } } diff --git a/LibGit2Sharp/Core/NativeDllName.cs b/LibGit2Sharp/Core/NativeDllName.cs new file mode 100644 index 00000000..47257819 --- /dev/null +++ b/LibGit2Sharp/Core/NativeDllName.cs @@ -0,0 +1,7 @@ +namespace LibGit2Sharp.Core +{ + internal static class NativeDllName + { + public const string Name = "git2-5aee963"; + } +} diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index 152d545e..a7f6f57c 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -14,7 +14,7 @@ namespace LibGit2Sharp.Core internal static class NativeMethods { public const uint GIT_PATH_MAX = 4096; - private const string libgit2 = "git2"; + private const string libgit2 = NativeDllName.Name; private static readonly LibraryLifetimeObject lifetimeObject; private static int handlesCount; @@ -656,7 +656,6 @@ namespace LibGit2Sharp.Core internal static extern int git_reference_foreach_glob( RepositorySafeHandle repo, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string glob, - GitReferenceType flags, ref_glob_callback callback, IntPtr payload); diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index b1ddf84f..f7ed77ae 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -1151,10 +1151,9 @@ namespace LibGit2Sharp.Core public static ICollection<TResult> git_reference_foreach_glob<TResult>( RepositorySafeHandle repo, string glob, - GitReferenceType flags, Func<IntPtr, TResult> resultSelector) { - return git_foreach(resultSelector, c => NativeMethods.git_reference_foreach_glob(repo, glob, flags, (x, p) => c(x, p), IntPtr.Zero)); + return git_foreach(resultSelector, c => NativeMethods.git_reference_foreach_glob(repo, glob, (x, p) => c(x, p), IntPtr.Zero)); } public static void git_reference_free(IntPtr reference) @@ -1170,12 +1169,12 @@ namespace LibGit2Sharp.Core return (res == 1); } - public static IList<string> git_reference_list(RepositorySafeHandle repo, GitReferenceType flags) + public static IList<string> git_reference_list(RepositorySafeHandle repo) { using (ThreadAffinity()) { UnSafeNativeMethods.git_strarray arr; - int res = UnSafeNativeMethods.git_reference_list(out arr, repo, flags); + int res = UnSafeNativeMethods.git_reference_list(out arr, repo); Ensure.ZeroResult(res); return Libgit2UnsafeHelper.BuildListOf(arr); diff --git a/LibGit2Sharp/Core/UnSafeNativeMethods.cs b/LibGit2Sharp/Core/UnSafeNativeMethods.cs index 49093e6e..3d692d9d 100644 --- a/LibGit2Sharp/Core/UnSafeNativeMethods.cs +++ b/LibGit2Sharp/Core/UnSafeNativeMethods.cs @@ -6,10 +6,10 @@ namespace LibGit2Sharp.Core { internal static unsafe class UnSafeNativeMethods { - private const string libgit2 = "git2"; + private const string libgit2 = NativeDllName.Name; [DllImport(libgit2)] - internal static extern int git_reference_list(out git_strarray array, RepositorySafeHandle repo, GitReferenceType flags); + internal static extern int git_reference_list(out git_strarray array, RepositorySafeHandle repo); [DllImport(libgit2)] internal static extern int git_remote_list(out git_strarray array, RepositorySafeHandle repo); diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index da4a719d..65a9f90e 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -68,6 +68,7 @@ <Compile Include="CheckoutCallbacks.cs" /> <Compile Include="CheckoutOptions.cs" /> <Compile Include="CompareOptions.cs" /> + <Compile Include="Core\NativeDllName.cs" /> <Compile Include="ObjectType.cs" /> <Compile Include="ReferenceExtensions.cs" /> <Compile Include="Conflict.cs" /> diff --git a/LibGit2Sharp/ReferenceCollection.cs b/LibGit2Sharp/ReferenceCollection.cs index 7a03fd15..76db39e7 100644 --- a/LibGit2Sharp/ReferenceCollection.cs +++ b/LibGit2Sharp/ReferenceCollection.cs @@ -50,7 +50,7 @@ namespace LibGit2Sharp /// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the collection.</returns> public virtual IEnumerator<Reference> GetEnumerator() { - return Proxy.git_reference_list(repo.Handle, GitReferenceType.ListAll) + return Proxy.git_reference_list(repo.Handle) .Select(n => this[n]) .GetEnumerator(); } @@ -267,7 +267,7 @@ namespace LibGit2Sharp { Ensure.ArgumentNotNullOrEmptyString(pattern, "pattern"); - return Proxy.git_reference_foreach_glob(repo.Handle, pattern, GitReferenceType.ListAll, Utf8Marshaler.FromNative) + return Proxy.git_reference_foreach_glob(repo.Handle, pattern, Utf8Marshaler.FromNative) .Select(n => this[n]); } diff --git a/LibGit2Sharp/libgit2_hash.txt b/LibGit2Sharp/libgit2_hash.txt index 5d90d86d..29573207 100644 --- a/LibGit2Sharp/libgit2_hash.txt +++ b/LibGit2Sharp/libgit2_hash.txt @@ -1 +1 @@ -b641c00eebb3c60e8719c0dfc55dde91ca30a5d2 +5aee96329ab7869cbe90cf80fd2a3f8f4dc5dccf diff --git a/LibGit2Sharp/libgit2sharp_hash.txt b/LibGit2Sharp/libgit2sharp_hash.txt index 0faec602..35466456 100644 --- a/LibGit2Sharp/libgit2sharp_hash.txt +++ b/LibGit2Sharp/libgit2sharp_hash.txt @@ -1 +1 @@ -unknown +unknown |