Skip to content

Commit 8f8627b

Browse files
author
Alex White
committed
- Fix tor the "undefined symbol: git_index_get in Unknown on line 0" error for the php module
1 parent b28d145 commit 8f8627b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ PHP_METHOD(git2_index, writeTree)
9494
int error = 0;
9595

9696
m_index = PHP_GIT2_GET_OBJECT(php_git2_index, getThis());
97-
error = git_tree_create_fromindex(&tree_oid, m_index->index);
97+
error = git_index_write_tree(&tree_oid, m_index->index);
9898

9999
git_oid_fmt(oid_out, &tree_oid);
100100
RETVAL_STRINGL(oid_out,GIT_OID_HEXSZ,1);
@@ -115,7 +115,7 @@ PHP_METHOD(git2_index, current)
115115
zval *z_entry;
116116

117117
m_index = PHP_GIT2_GET_OBJECT(php_git2_index, getThis());
118-
entry = git_index_get(m_index->index, m_index->offset);
118+
entry = git_index_get_byindex(m_index->index, m_index->offset);
119119
if (entry == NULL) {
120120
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
121121
"specified offset does not exist. %d");
@@ -199,4 +199,4 @@ void php_git2_index_init(TSRMLS_D)
199199
git2_index_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
200200
git2_index_class_entry->create_object = php_git2_index_new;
201201
zend_class_implements(git2_index_class_entry TSRMLS_CC, 1, spl_ce_Iterator);
202-
}
202+
}

0 commit comments

Comments
 (0)