Skip to content

Commit 325445b

Browse files
committed
[reflog] implement git_reflog_entry_byindex
1 parent f6a9467 commit 325445b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

reflog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ PHP_FUNCTION(git_reflog_entry_byindex)
161161
{
162162
const git_reflog_entry *result = NULL;
163163
zval *reflog = NULL;
164-
php_git2_t *_reflog = NULL;
164+
php_git2_t *_reflog = NULL, *_result;
165165
long idx = 0;
166166

167167
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
@@ -171,7 +171,10 @@ PHP_FUNCTION(git_reflog_entry_byindex)
171171

172172
ZEND_FETCH_RESOURCE(_reflog, php_git2_t*, &reflog, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle);
173173
result = git_reflog_entry_byindex(PHP_GIT2_V(_reflog, reflog), idx);
174-
/* TODO(chobie): implement this */
174+
if (php_git2_make_resource(&_result, PHP_GIT2_TYPE_REFLOG_ENTRY, result, 0 TSRMLS_CC)) {
175+
RETURN_FALSE;
176+
}
177+
ZVAL_RESOURCE(return_value, GIT_RVAL_P(_result));
175178
}
176179
/* }}} */
177180

0 commit comments

Comments
 (0)