Skip to content

Commit eb8cd9b

Browse files
committed
update libgit2
1 parent 351b3c0 commit eb8cd9b

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

config.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,20 @@ static int php_git2_config_resolve(zval **result, const char *var_name, zval *m_
209209
return error;
210210
}
211211

212-
static int php_git2_config_foreach(const char *var_name, const char *value, void *payload)
212+
static int php_git2_config_foreach(const git_config_entry * entry, void *payload)
213213
{
214214
HashTable *hash;
215-
zval *entry, **target_offset;
215+
zval *zentry, **target_offset;
216216
const char *config_value;
217217
char *current_key, *tmp_value, *savedptr, *k;
218218
php_git2_config_foreach_t *opaque = (php_git2_config_foreach_t *)payload;
219219
int error = 0;
220220

221221
hash = Z_ARRVAL_P(opaque->result);
222222

223-
error = git_config_get_string(&config_value, opaque->config, var_name);
223+
error = git_config_get_string(&config_value, opaque->config, entry->name);
224224

225-
tmp_value = estrdup(var_name);
225+
tmp_value = estrdup(entry->name);
226226
current_key = php_strtok_r(tmp_value, ".", &savedptr);
227227
while (current_key != NULL) {
228228
k = current_key;
@@ -234,20 +234,24 @@ static int php_git2_config_foreach(const char *var_name, const char *value, void
234234
hash = Z_ARRVAL_P(*target_offset);
235235
}
236236
} else {
237-
MAKE_STD_ZVAL(entry);
238-
array_init(entry);
239-
zend_hash_add(hash, k, strlen(k)+1, (void **)&entry, sizeof(entry), NULL);
240-
hash = Z_ARRVAL_P(entry);
237+
MAKE_STD_ZVAL(zentry);
238+
array_init(zentry);
239+
zend_hash_add(hash, k, strlen(k)+1, (void **)&zentry, sizeof(zentry), NULL);
240+
hash = Z_ARRVAL_P(zentry);
241241
}
242242
}
243243
}
244244

245245
if (k != NULL) {
246-
MAKE_STD_ZVAL(entry);
247-
ZVAL_STRING(entry, config_value, 1);
248-
zend_hash_add(hash, k, strlen(k)+1, (void **)&entry, sizeof(entry), NULL);
249-
Z_ADDREF_P(entry);
250-
zval_ptr_dtor(&entry);
246+
MAKE_STD_ZVAL(zentry);
247+
if (config_value) {
248+
ZVAL_STRING(zentry, config_value, 1);
249+
} else {
250+
ZVAL_NULL(zentry);
251+
}
252+
zend_hash_add(hash, k, strlen(k)+1, (void **)&zentry, sizeof(zentry), NULL);
253+
Z_ADDREF_P(zentry);
254+
zval_ptr_dtor(&zentry);
251255
}
252256
efree(tmp_value);
253257

@@ -273,7 +277,7 @@ static int php_git2_config_reload(zval *object, unsigned short dtor TSRMLS_DC)
273277

274278
payload.config = m_config->config;
275279
payload.result = entry;
276-
error = git_config_foreach(m_config->config,&php_git2_config_foreach,&payload);
280+
error = git_config_foreach(m_config->config, &php_git2_config_foreach, &payload);
277281
add_property_zval(object, "configs", entry);
278282
if (dtor == 1) {
279283
zval_ptr_dtor(&entry);

libgit2

Submodule libgit2 updated 420 files

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ PHP_METHOD(git2_remote, fetch)
125125
{
126126
php_git2_remote *m_remote;
127127
git_indexer *idx = NULL;
128-
git_indexer_stats stats;
128+
git_transfer_progress stats;
129129
char *packname = NULL;
130130
int error = 0;
131131
long direction = 0;

0 commit comments

Comments
 (0)