diff options
author | Russell Belfer <rb@github.com> | 2013-03-06 04:10:05 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-03-07 04:52:01 +0400 |
commit | 169dc61607b69726c6012ab70758692637928a85 (patch) | |
tree | 01593b00741391d9c9d6aad6344aed4cbc8ef6a4 /src/submodule.c | |
parent | ed4f95e5d9f2f59dc5d5a4b76a696b0595b6175d (diff) |
Make iterator APIs consistent with standards
The iterator APIs are not currently consistent with the parameter
ordering of the rest of the codebase. This rearranges the order
of parameters, simplifies the naming of a number of functions, and
makes somewhat better use of macros internally to clean up the
iterator code.
This also expands the test coverage of iterator functionality,
making sure that case sensitive range-limited iteration works
correctly.
Diffstat (limited to 'src/submodule.c')
-rw-r--r-- | src/submodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/submodule.c b/src/submodule.c index 359306498..c02061376 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -1135,10 +1135,10 @@ static int load_submodule_config_from_index( const git_index_entry *entry; if ((error = git_repository_index__weakptr(&index, repo)) < 0 || - (error = git_iterator_for_index(&i, index)) < 0) + (error = git_iterator_for_index(&i, index, 0, NULL, NULL)) < 0) return error; - error = git_iterator_current(i, &entry); + error = git_iterator_current(&entry, i); while (!error && entry != NULL) { @@ -1154,7 +1154,7 @@ static int load_submodule_config_from_index( git_oid_cpy(gitmodules_oid, &entry->oid); } - error = git_iterator_advance(i, &entry); + error = git_iterator_advance(&entry, i); } git_iterator_free(i); @@ -1173,12 +1173,12 @@ static int load_submodule_config_from_head( if ((error = git_repository_head_tree(&head, repo)) < 0) return error; - if ((error = git_iterator_for_tree(&i, head)) < 0) { + if ((error = git_iterator_for_tree(&i, head, 0, NULL, NULL)) < 0) { git_tree_free(head); return error; } - error = git_iterator_current(i, &entry); + error = git_iterator_current(&entry, i); while (!error && entry != NULL) { @@ -1195,7 +1195,7 @@ static int load_submodule_config_from_head( git_oid_cpy(gitmodules_oid, &entry->oid); } - error = git_iterator_advance(i, &entry); + error = git_iterator_advance(&entry, i); } git_iterator_free(i); |