Commit 43521d06 by Vicent Marti

refs: Rename git_referece_listcb to _foreach

Same name as `git_config_foreach`
parent 607d1643
...@@ -299,10 +299,9 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, ...@@ -299,10 +299,9 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo,
/** /**
* List all the references in the repository, calling a custom * Perform an operation on each reference in the repository
* callback for each one.
* *
* The listed references may be filtered by type, or using * The processed references may be filtered by type, or using
* a bitwise OR of several types. Use the magic value * a bitwise OR of several types. Use the magic value
* `GIT_REF_LISTALL` to obtain all references, including * `GIT_REF_LISTALL` to obtain all references, including
* packed ones. * packed ones.
...@@ -318,7 +317,7 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, ...@@ -318,7 +317,7 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo,
* @param payload Additional data to pass to the callback * @param payload Additional data to pass to the callback
* @return 0 on success; error code otherwise * @return 0 on success; error code otherwise
*/ */
GIT_EXTERN(int) git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload); GIT_EXTERN(int) git_reference_foreach(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload);
/** @} */ /** @} */
GIT_END_DECL GIT_END_DECL
......
...@@ -1086,7 +1086,7 @@ static int reference_available(git_repository *repo, const char *ref, const char ...@@ -1086,7 +1086,7 @@ static int reference_available(git_repository *repo, const char *ref, const char
git_vector_insert(&refs, (void *)ref); git_vector_insert(&refs, (void *)ref);
git_vector_insert(&refs, (void *)old_ref); git_vector_insert(&refs, (void *)old_ref);
error = git_reference_listcb(repo, GIT_REF_LISTALL, _reference_available_cb, (void *)&refs); error = git_reference_foreach(repo, GIT_REF_LISTALL, _reference_available_cb, (void *)&refs);
git_vector_free(&refs); git_vector_free(&refs);
...@@ -1573,7 +1573,7 @@ int git_reference_packall(git_repository *repo) ...@@ -1573,7 +1573,7 @@ int git_reference_packall(git_repository *repo)
return packed_write(repo); return packed_write(repo);
} }
int git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload) int git_reference_foreach(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload)
{ {
int error; int error;
struct dirent_list_data data; struct dirent_list_data data;
...@@ -1625,7 +1625,7 @@ int git_reference_listall(git_strarray *array, git_repository *repo, unsigned in ...@@ -1625,7 +1625,7 @@ int git_reference_listall(git_strarray *array, git_repository *repo, unsigned in
if (git_vector_init(&ref_list, 8, NULL) < GIT_SUCCESS) if (git_vector_init(&ref_list, 8, NULL) < GIT_SUCCESS)
return GIT_ENOMEM; return GIT_ENOMEM;
error = git_reference_listcb(repo, list_flags, &cb__reflist_add, (void *)&ref_list); error = git_reference_foreach(repo, list_flags, &cb__reflist_add, (void *)&ref_list);
if (error < GIT_SUCCESS) { if (error < GIT_SUCCESS) {
git_vector_free(&ref_list); git_vector_free(&ref_list);
......
...@@ -450,7 +450,7 @@ int git_tag_list(git_strarray *tag_names, git_repository *repo) ...@@ -450,7 +450,7 @@ int git_tag_list(git_strarray *tag_names, git_repository *repo)
if (git_vector_init(&taglist, 8, NULL) < GIT_SUCCESS) if (git_vector_init(&taglist, 8, NULL) < GIT_SUCCESS)
return GIT_ENOMEM; return GIT_ENOMEM;
error = git_reference_listcb(repo, GIT_REF_OID|GIT_REF_PACKED, &tag_list_cb, (void *)&taglist); error = git_reference_foreach(repo, GIT_REF_OID|GIT_REF_PACKED, &tag_list_cb, (void *)&taglist);
if (error < GIT_SUCCESS) { if (error < GIT_SUCCESS) {
git_vector_free(&taglist); git_vector_free(&taglist);
return git__rethrow(error, "Failed to list tags"); return git__rethrow(error, "Failed to list tags");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment