@@ -47,11 +47,6 @@ zend_object_value php_git2_tree_new(zend_class_entry *ce TSRMLS_DC)
4747 return retval ;
4848}
4949
50- ZEND_BEGIN_ARG_INFO_EX (arginfo_git2_tree_diff , 0 ,0 ,2 )
51- ZEND_ARG_INFO (0 , old )
52- ZEND_ARG_INFO (0 , new )
53- ZEND_END_ARG_INFO ()
54-
5550ZEND_BEGIN_ARG_INFO_EX (arginfo_git2_tree_get_subtree , 0 ,0 ,1 )
5651 ZEND_ARG_INFO (0 , path )
5752ZEND_END_ARG_INFO ()
@@ -60,49 +55,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_git2_tree_get_entry_by_name, 0,0,1)
6055 ZEND_ARG_INFO (0 , path )
6156ZEND_END_ARG_INFO ()
6257
63-
64- static int php_git2_tree_diff_cb (const git_tree_diff_data * ptr , void * data )
65- {
66- /*
67- typedef struct {
68- unsigned int old_attr;
69- unsigned int new_attr;
70- git_oid old_oid;
71- git_oid new_oid;
72- git_status_t status;
73- const char *path;
74- } git_tree_diff_data;
75- */
76- fprintf (stderr ,"path:%s\n" ,ptr -> path );
77- }
7858
79- typedef struct {
80- zval * old ;
81- zval * new ;
82- zval * result ;
83- } php_git2_tree_diff_cb_t ;
84- /*
85- {{{ proto: Git2\Tree::diff($old, $new)
86- @todo: think this behavior
87- */
88- PHP_METHOD (git2_tree , diff )
89- {
90- zval * old , * new ;
91- php_git2_tree * m_old , * m_new ;
92- php_git2_tree_diff_cb_t payload ;
93-
94- if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC ,
95- "OO" , & old , git2_tree_class_entry , & new , git2_tree_class_entry ) == FAILURE ) {
96- return ;
97- }
98-
99- m_old = PHP_GIT2_GET_OBJECT (php_git2_tree , old );
100- m_new = PHP_GIT2_GET_OBJECT (php_git2_tree , new );
101-
102- git_tree_diff (m_old -> tree ,m_new -> tree , & php_git2_tree_diff_cb , & payload );
103- }
104- /* }}} */
105-
10659
10760/* Iterator Implementation */
10861
@@ -224,7 +177,7 @@ static int get_subtree(git_tree **result, git_tree *root, char *path)
224177 git_tree_entry_id (entry )
225178 );
226179
227- if (error == GIT_SUCCESS ) {
180+ if (error == GIT_OK ) {
228181 target = tmp_result ;
229182 } else {
230183 return -1 ;
@@ -243,7 +196,7 @@ static int get_subtree(git_tree **result, git_tree *root, char *path)
243196 git_object_id ((const git_object * )entry )
244197 );
245198
246- if (error == GIT_SUCCESS ) {
199+ if (error == GIT_OK ) {
247200 target = tmp_result ;
248201 } else {
249202 return -1 ;
@@ -288,7 +241,7 @@ PHP_METHOD(git2_tree, getSubtree)
288241 * this method returns specified subtree or false.
289242 */
290243 error = get_subtree (& subtree , object -> tree , path );
291- if (error == GIT_SUCCESS ) {
244+ if (error == GIT_OK ) {
292245 zval * result ;
293246
294247 result = php_git2_object_new (git_object_owner ((git_object * )object -> tree ), (git_object * )subtree TSRMLS_CC );
@@ -331,7 +284,6 @@ PHP_METHOD(git2_tree, getEntryByName)
331284
332285
333286static zend_function_entry php_git2_tree_methods [] = {
334- PHP_ME (git2_tree , diff , arginfo_git2_tree_diff , ZEND_ACC_PUBLIC | ZEND_ACC_STATIC )
335287 /* Iterator Implementation */
336288 PHP_ME (git2_tree , current , NULL , ZEND_ACC_PUBLIC )
337289 PHP_ME (git2_tree , key , NULL , ZEND_ACC_PUBLIC )
0 commit comments