Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-05-15 12:14:53 +0400
committernulltoken <emeric.fermas@gmail.com>2013-05-26 21:06:44 +0400
commit96df5f8d6d3e35f8aadafdc25a95ede3eb9e86b5 (patch)
treef3c09871aca1947ec920cfd470480b792c3a2346 /LibGit2Sharp
parent96553dffb2204c3debe2a8cc9e3bb6abe6e3e38e (diff)
Update libgit2 binaries to 5aee963
https://github.com/libgit2/libgit2/compare/b641c00...5aee963 This also change naming convention of libgit2 binaries. Each LibGit2Sharp version works against a specific version of libgit2. LibGit2Sharp managed code relies on the dynamic loader to find the proper libgit2 binary. This binary is located in a directory structure next to the managed assembly, and the loader is instructed to search within this directory structure. Up until now, the binary being searched for was bearing a generic name: [lib]git2.(dll|so|dylib). However, on Windows, if one older version of the native binary, with the same name, is already loaded in the memory, the loader will reuse this one, no matter what directory it's been loaded from. Chances are great that this old libgit2 version is incompatible with what the newer version of LibGit2Sharp expects from its API or behavior. In order to mitigate this, libgit2 binaries are now suffixed with the libgit2 commit sha they've been build from and LibGit2Sharp will bind to a specifically named binary: - git2-{short_sha}.dll on Windows - libgit2-{short_sha}.so on Linux - libgit2-{short_sha}.dylib on Mac OS X. This should allow one to run two different future version of LibGit2Sharp, side by side, without any name clash.
Diffstat (limited to 'LibGit2Sharp')
-rw-r--r--LibGit2Sharp/Core/Handles/GitErrorSafeHandle.cs9
-rw-r--r--LibGit2Sharp/Core/NativeDllName.cs7
-rw-r--r--LibGit2Sharp/Core/NativeMethods.cs3
-rw-r--r--LibGit2Sharp/Core/Proxy.cs7
-rw-r--r--LibGit2Sharp/Core/UnSafeNativeMethods.cs4
-rw-r--r--LibGit2Sharp/LibGit2Sharp.csproj1
-rw-r--r--LibGit2Sharp/ReferenceCollection.cs4
-rw-r--r--LibGit2Sharp/libgit2_hash.txt2
-rw-r--r--LibGit2Sharp/libgit2sharp_hash.txt2
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