Skip to content

Commit 351b3c0

Browse files
committed
update libgit2
1 parent 1cf6860 commit 351b3c0

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

git2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ zval* php_git2_object_new(git_repository *repository, git_object *object TSRMLS_
145145
object_init_ex(m_entry, git2_tree_entry_class_entry);
146146
add_property_stringl_ex(m_entry, "name", sizeof("name"), (const char *)entry_name, strlen(entry_name), 1 TSRMLS_CC);
147147
add_property_stringl_ex(m_entry, "oid", sizeof("oid"), (const char *)entry_oid, strlen(entry_oid), 1 TSRMLS_CC);
148-
add_property_long_ex(m_entry, "attributes", sizeof("attributes"), git_tree_entry_attributes(entry) TSRMLS_CC);
148+
add_property_long_ex(m_entry, "attributes", sizeof("attributes"), git_tree_entry_filemode(entry) TSRMLS_CC);
149149
add_next_index_zval(m_array, m_entry);
150150
}
151151

libgit2

Submodule libgit2 updated 516 files

php_git2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static inline void create_tree_entry_from_entry(zval **object, git_tree_entry *e
281281

282282
add_property_string(*object, "name", (char *)git_tree_entry_name(entry), 1);
283283
add_property_string(*object, "oid", buf, 1);
284-
add_property_long(*object, "attributes", git_tree_entry_attributes(entry));
284+
add_property_long(*object, "attributes", git_tree_entry_filemode(entry));
285285
}
286286

287287
static inline void php_git2_create_index_entry(zval **object, git_index_entry *entry TSRMLS_DC)

repository.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_git2_repository_lookup, 0,0,1)
8686
ZEND_ARG_INFO(0, type)
8787
ZEND_END_ARG_INFO()
8888

89+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git2_repository_checkout, 0,0,0)
90+
ZEND_END_ARG_INFO()
91+
8992
static int php_git2_repository_initialize(zval *object, git_repository *repository TSRMLS_DC)
9093
{
9194
zval *odb;
@@ -497,6 +500,33 @@ PHP_METHOD(git2_repository, hash)
497500
/* }}} */
498501

499502

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+
500530
static zend_function_entry php_git2_repository_methods[] = {
501531
PHP_ME(git2_repository, __construct, arginfo_git2_repository___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
502532
PHP_ME(git2_repository, isEmpty, NULL, ZEND_ACC_PUBLIC)
@@ -511,6 +541,7 @@ static zend_function_entry php_git2_repository_methods[] = {
511541
PHP_ME(git2_repository, hash, arginfo_git2_repository_hash, ZEND_ACC_PUBLIC)
512542
PHP_ME(git2_repository, write, arginfo_git2_repository_write, ZEND_ACC_PUBLIC)
513543
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)
514545
#ifdef lookup
515546
#undef lookup
516547
#endif

0 commit comments

Comments
 (0)