@@ -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 ( ) )
1529- {
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