8000 Merge pull request #919 from libgit2/ethomson/libgit2_update · octoco/libgit2sharp@29e6a3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 29e6a3c

Browse files
committed
Merge pull request libgit2#919 from libgit2/ethomson/libgit2_update
Update libgit2 to d5712ed
2 parents ae69104 + 397c685 commit 29e6a3c

17 files changed

+109
-233
lines changed
979 KB
Binary file not shown.
-975 KB
Binary file not shown.
744 KB
Binary file not shown.
-740 KB
Binary file not shown.

LibGit2Sharp/Core/Handles/PushSafeHandle.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

LibGit2Sharp/Core/NativeDllName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace LibGit2Sharp.Core
22
{
33
internal static class NativeDllName
44
{
5-
public const string Name = "git2-dce7b1a";
5+
public const string Name = "git2-d5712ed";
66
}
77
}

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -811,52 +811,10 @@ internal static extern int git_patch_line_stats(
811811
[DllImport(libgit2)]
812812
internal static extern void git_patch_free(IntPtr patch);
813813

814-
[DllImport(libgit2)]
815-
internal static extern int git_push_new(out PushSafeHandle push, RemoteSafeHandle remote);
816-
817814
/* Push network progress notification function */
818815
internal delegate int git_push_transfer_progress(uint current, uint total, UIntPtr bytes, IntPtr payload);
819816
internal delegate int git_packbuilder_progress(int stage, uint current, uint total, IntPtr payload);
820817

821-
[DllImport(libgit2)]
822-
internal static extern int git_push_set_callbacks(
823-
PushSafeHandle push,
824-
git_packbuilder_progress pack_progress_cb,
825-
IntPtr pack_progress_cb_payload,
826-
git_push_transfer_progress transfer_progress_cb,
827-
IntPtr transfer_progress_cb_payload);
828-
829-
[DllImport(libgit2)]
830-
internal static extern int git_push_set_options(PushSafeHandle push, GitPushOptions options);
831-
832-
[DllImport(libgit2)]
833-
internal static extern int git_push_add_refspec(
834-
PushSafeHandle push,
835-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string pushRefSpec);
836-
837-
[DllImport(libgit2)]
838-
internal static extern int git_push_finish(PushSafeHandle push);
839-
840-
[DllImport(libgit2)]
841-
internal static extern void git_push_free(IntPtr push);
842-
843-
[DllImport(libgit2)]
844-
internal static extern int git_push_status_foreach(
845-
PushSafeHandle push,
846-
push_status_foreach_cb status_cb,
847-
IntPtr data);
848-
849-
internal delegate int push_status_foreach_cb(
850-
IntPtr reference,
851-
IntPtr msg,
852-
IntPtr data);
853-
854-
[DllImport(libgit2)]
855-
internal static extern int git_push_update_tips(
856-
PushSafeHandle push,
857-
SignatureSafeHandle signature,
858-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string log_message);
859-
860818
[DllImport(libgit2)]
861819
internal static extern int git_reference_create(
862820
out ReferenceSafeHandle reference,
@@ -1071,6 +1029,14 @@ internal static extern int git_remote_fetch(
10711029
[DllImport(libgit2)]
10721030
internal static extern int git_remote_get_push_refspecs(out GitStrArray array, RemoteSafeHandle remote);
10731031

1032+
[DllImport(libgit2)]
1033+
internal static extern int git_remote_push(
1034+
RemoteSafeHandle remote,
1035+
ref GitStrArray refSpecs,
1036+
GitPushOptions opts,
1037+
SignatureSafeHandle signature,
1038+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string reflogMessage);
1039+
10741040
[DllImport(libgit2)]
10751041
internal static extern UIntPtr git_remote_refspec_count(RemoteSafeHandle remote);
10761042

@@ -1555,7 +1521,7 @@ internal static extern int git_tree_entry_bypath(
15551521
internal static extern UIntPtr git_tree_entrycount(GitObjectSafeHandle tree);
15561522

15571523
[DllImport(libgit2)]
1558-
internal static extern int git_treebuilder_create(out TreeBuilderSafeHandle builder, RepositorySafeHandle repo, IntPtr src);
1524+
internal static extern int git_treebuilder_new(out TreeBuilderSafeHandle builder, RepositorySafeHandle repo, IntPtr src);
15591525

15601526
[DllImport(libgit2)]
15611527
internal static extern int git_treebuilder_insert(

LibGit2Sharp/Core/Proxy.cs

Lines changed: 25 additions & 80 deletions
1529
Original file line numberDiff line numberDiff line change
@@ -1498,84 +1498,6 @@ public static Tuple<int, int> git_patch_line_stats(PatchSafeHandle patch)
14981498

14991499
#endregion
15001500

1501-
#region git_push_
1502-
1503-
public static void git_push_add_refspec(PushSafeHandle push, string pushRefSpec)
1504-
{
1505-
using (ThreadAffinity())
1506-
{
1507-
int res = NativeMethods.git_push_add_refspec(push, pushRefSpec);
1508-
Ensure.ZeroResult(res);
1509-
}
1510-
}
1511-
1512-
public static void git_push_finish(PushSafeHandle push)
1513-
{
1514-
using (ThreadAffinity())
1515-
{
1516-
int res = NativeMethods.git_push_finish(push);
1517-
Ensure.ZeroResult(res);
1518-
}
1519-
}
1520-
1521-
public static void git_push_free(IntPtr push)
1522-
{
1523-
NativeMethods.git_push_free(push);
1524-
}
1525-
1526-
public static PushSafeHandle git_push_new(RemoteSafeHandle remote)
1527-
{
1528-
using (ThreadAffinity())
-
{
1530-
PushSafeHandle handle;
1531-
int res = NativeMethods.git_push_new(out handle, remote);
1532-
Ensure.ZeroResult(res);
1533-
return handle;
1534-
}
1535-
}
1536-
1537-
public static void git_push_set_callbacks(
1538-
PushSafeHandle push,
1539-
NativeMethods.git_push_transfer_progress pushTransferProgress,
1540-
NativeMethods.git_packbuilder_progress packBuilderProgress)
1541-
{
1542-
using (ThreadAffinity())
1543-
{
1544-
int res = NativeMethods.git_push_set_callbacks(push, packBuilderProgress, IntPtr.Zero, pushTransferProgress, IntPtr.Zero);
1545-
Ensure.ZeroResult(res);
1546-
}
1547-
}
1548-
1549-
public static void git_push_set_options(PushSafeHandle push, GitPushOptions options)
1550-
{
1551-
using (ThreadAffinity())
1552-
{
1553-
int res = NativeMethods.git_push_set_options(push, options);
1554-
Ensure.ZeroResult(res);
1555-
}
1556-
}
1557-
1558-
public static void git_push_status_foreach(PushSafeHandle push, NativeMethods.push_status_foreach_cb status_cb)
1559-
{
1560-
using (ThreadAffinity())
1561-
{
1562-
int res = NativeMethods.git_push_status_foreach(push, status_cb, IntPtr.Zero);
1563-
Ensure.ZeroResult(res);
1564-
}
1565-
}
1566-
1567-
public static void git_push_update_tips(PushSafeHandle push, Signature signature, string logMessage)
1568-
{
1569-
using (ThreadAffinity())
1570-
using (var sigHandle = signature.BuildHandle())
1571-
{
1572-
int res = NativeMethods.git_push_update_tips(push, sigHandle, logMessage);
1573-
Ensure.ZeroResult(res);
1574-
}
1575-
}
1576-
1577-
#endregion
1578-
15791501
#region git_reference_
15801502

15811503
public static ReferenceSafeHandle git_reference_create(RepositorySafeHandle repo, string name, ObjectId targetId, bool allowOverwrite,
@@ -1969,6 +1891,29 @@ public static IList<string> git_remote_get_push_refspecs(RemoteSafeHandle remote
19691891
}
19701892
}
19711893

1894+
public static void git_remote_push(RemoteSafeHandle remote, IEnumerable<string> refSpecs, GitPushOptions opts, Signature signature, string reflogMessage)
1895+
{
1896+
using (ThreadAffinity())
1897+
{
1898+
using (var sigHandle = signature.BuildHandle())
1899+
{
1900+
var array = new GitStrArrayManaged();
1901+
1902+
try
1903+
{
1904+
array = GitStrArrayManaged.BuildFrom(refSpecs.ToArray());
1905+
1906+
int res = NativeMethods.git_remote_push(remote, ref array.Array, opts, sigHandle, reflogMessage);
1907+
Ensure.ZeroResult(res);
1908+
}
1909+
finally
1910+
{
1911+
array.Dispose();
1912+
}
1913+
}
1914+
}
1915+
}
1916+
19721917
public static void git_remote_set_fetch_refspecs(RemoteSafeHandle remote, IEnumerable<string> refSpecs)
19731918
{
19741919
using (ThreadAffinity())
@@ -3076,12 +3021,12 @@ public static int git_tree_entrycount(GitObjectSafeHandle tree)
30763021

30773022
#region git_treebuilder_
30783023

3079-
public static TreeBuilderSafeHandle git_treebuilder_create(RepositorySafeHandle repo)
3024+
public static TreeBuilderSafeHandle git_treebuilder_new(RepositorySafeHandle repo)
30803025
{
30813026
using (ThreadAffinity())
30823027
{
30833028
TreeBuilderSafeHandle builder;
3084-
int res = NativeMethods.git_treebuilder_create(out builder, repo, IntPtr.Zero);
3029+
int res = NativeMethods.git_treebuilder_new(out builder, repo, IntPtr.Zero);
30853030
Ensure.ZeroResult(res);
30863031

30873032
return builder;

0 commit comments

Comments
 (0)
0