Skip to content

Commit 0a19b95

Browse files
author
liuguangzhao
committed
fix: for libgit2-0.19.0
1 parent ace0257 commit 0a19b95

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

php_git2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# include <git2.h>
4242
# include <git2/errors.h>
4343
# include <git2/odb_backend.h>
44+
# include <git2/sys/odb_backend.h>
4445

4546
extern zend_module_entry git2_module_entry;
4647

reference.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ PHP_METHOD(git2_reference, each)
303303
MAKE_STD_ZVAL(opaque.result);
304304
array_init(opaque.result);
305305

306-
git_reference_foreach(m_repository->repository, list_flags, &php_git2_ref_foreach_cb, (void *)&opaque);
306+
git_reference_foreach(m_repository->repository, &php_git2_ref_foreach_cb, (void *)&opaque);
307+
// git_reference_foreach(m_repository->repository, list_flags, &php_git2_ref_foreach_cb, (void *)&opaque);
307308

308309
RETVAL_ZVAL(opaque.result,0,1);
309310
}
@@ -334,4 +335,4 @@ void php_git2_reference_init(TSRMLS_D)
334335
INIT_NS_CLASS_ENTRY(ce, PHP_GIT2_NS, "Reference", php_git2_reference_methods);
335336
git2_reference_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
336337
git2_reference_class_entry->create_object = php_git2_reference_new;
337-
}
338+
}

remote.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
* THE SOFTWARE.
2323
*/
2424

25+
#include <git2/indexer.h>
26+
2527
#include "php_git2.h"
2628

29+
30+
2731
PHPAPI zend_class_entry *git2_remote_class_entry;
2832

2933
static void php_git2_remote_free_storage(php_git2_remote *object TSRMLS_DC)
@@ -88,7 +92,7 @@ PHP_METHOD(git2_remote, __construct)
8892
/* }}} */
8993

9094

91-
static int php_git2_rename_packfile(char *packname, git_indexer *idx)
95+
static int php_git2_rename_packfile(char *packname, git_indexer_stream *idx)
9296
{
9397
char path[GIT_PATH_MAX], oid[GIT_OID_HEXSZ + 1], *slash;
9498
int ret;
@@ -124,7 +128,7 @@ static int show_ref__cb(git_remote_head *head, void *payload)
124128
PHP_METHOD(git2_remote, fetch)
125129
{
126130
php_git2_remote *m_remote;
127-
git_indexer *idx = NULL;
131+
git_indexer_stream *idx = NULL;
128132
git_transfer_progress stats;
129133
char *packname = NULL;
130134
int error = 0;
@@ -138,7 +142,8 @@ PHP_METHOD(git2_remote, fetch)
138142
return;
139143
}
140144
*/
141-
direction = GIT_DIR_FETCH;
145+
direction = 0;
146+
//direction = GIT_DIR_FETCH;
142147

143148
error = git_remote_connect(m_remote->remote, direction);
144149
error = git_remote_ls(m_remote->remote, &show_ref__cb, NULL);
@@ -180,4 +185,4 @@ void php_git2_remote_init(TSRMLS_D)
180185
INIT_NS_CLASS_ENTRY(ce, PHP_GIT2_NS, "Remote", php_git2_remote_methods);
181186
git2_remote_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
182187
git2_remote_class_entry->create_object = php_git2_remote_new;
183-
}
188+
}

0 commit comments

Comments
 (0)