@@ -86,6 +86,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_git2_repository_lookup, 0,0,1)
86
86
ZEND_ARG_INFO (0 , type )
87
87
ZEND_END_ARG_INFO ()
88
88
89
+ ZEND_BEGIN_ARG_INFO_EX (arginfo_git2_repository_checkout , 0 ,0 ,0 )
90
+ ZEND_END_ARG_INFO ()
91
+
89
92
static int php_git2_repository_initialize (zval * object , git_repository * repository TSRMLS_DC )
90
93
{
91
94
zval * odb ;
@@ -497,6 +500,33 @@ PHP_METHOD(git2_repository, hash)
497
500
/* }}} */
498
501
499
502
503
+ /*
504
+ {{{ proto: Git2\Repository::checkout(Git2\Tree $tree[, int $opts, zval $stats)
505
+ TODO: implement this
506
+ */
507
+ PHP_METHOD (git2_repository , checkout )
508
+ {
509
+ /*
510
+ php_git2_repository *m_repository;
511
+ php_git2_tree *m_tree;
512
+ zval *tree;
513
+ int error = 0;
514
+
515
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
516
+ "O", &tree, git2_tree_class_entry) == FAILURE) {
517
+ return;
518
+ }
519
+
520
+ m_repository = PHP_GIT2_GET_OBJECT(php_git2_repository, getThis());
521
+ m_tree = PHP_GIT2_GET_OBJECT(php_git2_tree, tree);
522
+
523
+ error = git_checkout_tree(m_repository->repository, m_tree->tree, NULL, NULL);
524
+ RETURN_LONG(error);
525
+ */
526
+ }
527
+ /* }}} */
528
+
529
+
500
530
static zend_function_entry php_git2_repository_methods [] = {
501
531
PHP_ME (git2_repository , __construct , arginfo_git2_repository___construct , ZEND_ACC_PUBLIC | ZEND_ACC_CTOR )
502
532
PHP_ME (git2_repository , isEmpty , NULL , ZEND_ACC_PUBLIC )
@@ -511,6 +541,7 @@ static zend_function_entry php_git2_repository_methods[] = {
511
541
PHP_ME (git2_repository , hash , arginfo_git2_repository_hash , ZEND_ACC_PUBLIC )
512
542
PHP_ME (git2_repository , write , arginfo_git2_repository_write , ZEND_ACC_PUBLIC )
513
543
PHP_ME (git2_repository , getMergeBase ,arginfo_git2_repository_get_merge_base ,ZEND_ACC_PUBLIC )
544
+ PHP_ME (git2_repository , checkout , arginfo_git2_repository_checkout , ZEND_ACC_PUBLIC )
514
545
#ifdef lookup
515
546
#undef lookup
516
547
#endif
0 commit comments