Commit 3679ebae by Arthur Schreiber

Horrible fix for #3173.

parent 460ae11f
...@@ -2521,7 +2521,8 @@ int git_checkout_iterator( ...@@ -2521,7 +2521,8 @@ int git_checkout_iterator(
if (data.opts.baseline_index) { if (data.opts.baseline_index) {
if ((error = git_iterator_for_index( if ((error = git_iterator_for_index(
&baseline, data.opts.baseline_index, &baseline_opts)) < 0) &baseline, git_index_owner(data.opts.baseline_index),
data.opts.baseline_index, &baseline_opts)) < 0)
goto cleanup; goto cleanup;
} else { } else {
if ((error = git_iterator_for_tree( if ((error = git_iterator_for_tree(
...@@ -2633,7 +2634,7 @@ int git_checkout_index( ...@@ -2633,7 +2634,7 @@ int git_checkout_index(
return error; return error;
GIT_REFCOUNT_INC(index); GIT_REFCOUNT_INC(index);
if (!(error = git_iterator_for_index(&index_i, index, NULL))) if (!(error = git_iterator_for_index(&index_i, repo, index, NULL)))
error = git_checkout_iterator(index_i, index, opts); error = git_checkout_iterator(index_i, index, opts);
if (owned) if (owned)
......
...@@ -1371,7 +1371,7 @@ int git_diff_tree_to_index( ...@@ -1371,7 +1371,7 @@ int git_diff_tree_to_index(
DIFF_FROM_ITERATORS( DIFF_FROM_ITERATORS(
git_iterator_for_tree(&a, old_tree, &a_opts), iflag, git_iterator_for_tree(&a, old_tree, &a_opts), iflag,
git_iterator_for_index(&b, index, &b_opts), iflag git_iterator_for_index(&b, repo, index, &b_opts), iflag
); );
/* if index is in case-insensitive order, re-sort deltas to match */ /* if index is in case-insensitive order, re-sort deltas to match */
...@@ -1395,7 +1395,7 @@ int git_diff_index_to_workdir( ...@@ -1395,7 +1395,7 @@ int git_diff_index_to_workdir(
return error; return error;
DIFF_FROM_ITERATORS( DIFF_FROM_ITERATORS(
git_iterator_for_index(&a, index, &a_opts), git_iterator_for_index(&a, repo, index, &a_opts),
GIT_ITERATOR_INCLUDE_CONFLICTS, GIT_ITERATOR_INCLUDE_CONFLICTS,
git_iterator_for_workdir(&b, repo, index, NULL, &b_opts), git_iterator_for_workdir(&b, repo, index, NULL, &b_opts),
...@@ -1472,8 +1472,8 @@ int git_diff_index_to_index( ...@@ -1472,8 +1472,8 @@ int git_diff_index_to_index(
assert(diff && old_index && new_index); assert(diff && old_index && new_index);
DIFF_FROM_ITERATORS( DIFF_FROM_ITERATORS(
git_iterator_for_index(&a, old_index, &a_opts), GIT_ITERATOR_DONT_IGNORE_CASE, git_iterator_for_index(&a, repo, old_index, &a_opts), GIT_ITERATOR_DONT_IGNORE_CASE,
git_iterator_for_index(&b, new_index, &b_opts), GIT_ITERATOR_DONT_IGNORE_CASE git_iterator_for_index(&b, repo, new_index, &b_opts), GIT_ITERATOR_DONT_IGNORE_CASE
); );
/* if index is in case-insensitive order, re-sort deltas to match */ /* if index is in case-insensitive order, re-sort deltas to match */
......
...@@ -2907,8 +2907,8 @@ int git_index_read_index( ...@@ -2907,8 +2907,8 @@ int git_index_read_index(
opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE;
if ((error = git_iterator_for_index(&index_iterator, index, &opts)) < 0 || if ((error = git_iterator_for_index(&index_iterator, git_index_owner(index), index, &opts)) < 0 ||
(error = git_iterator_for_index(&new_iterator, (git_index *)new_index, &opts)) < 0) (error = git_iterator_for_index(&new_iterator, git_index_owner(new_index), (git_index *)new_index, &opts)) < 0)
goto done; goto done;
if (((error = git_iterator_current(&old_entry, index_iterator)) < 0 && if (((error = git_iterator_current(&old_entry, index_iterator)) < 0 &&
......
...@@ -1080,6 +1080,7 @@ static void index_iterator__free(git_iterator *self) ...@@ -1080,6 +1080,7 @@ static void index_iterator__free(git_iterator *self)
int git_iterator_for_index( int git_iterator_for_index(
git_iterator **iter, git_iterator **iter,
git_repository *repo,
git_index *index, git_index *index,
git_iterator_options *options) git_iterator_options *options)
{ {
...@@ -1093,7 +1094,7 @@ int git_iterator_for_index( ...@@ -1093,7 +1094,7 @@ int git_iterator_for_index(
} }
ii->index = index; ii->index = index;
ITERATOR_BASE_INIT(ii, index, INDEX, git_index_owner(index)); ITERATOR_BASE_INIT(ii, index, INDEX, repo);
if ((error = iterator__update_ignore_case((git_iterator *)ii, options ? options->flags : 0)) < 0) { if ((error = iterator__update_ignore_case((git_iterator *)ii, options ? options->flags : 0)) < 0) {
git_iterator_free((git_iterator *)ii); git_iterator_free((git_iterator *)ii);
......
...@@ -95,6 +95,7 @@ extern int git_iterator_for_tree( ...@@ -95,6 +95,7 @@ extern int git_iterator_for_tree(
*/ */
extern int git_iterator_for_index( extern int git_iterator_for_index(
git_iterator **out, git_iterator **out,
git_repository *repo,
git_index *index, git_index *index,
git_iterator_options *options); git_iterator_options *options);
......
...@@ -2085,7 +2085,7 @@ static int iterator_for_annotated_commit( ...@@ -2085,7 +2085,7 @@ static int iterator_for_annotated_commit(
if (commit == NULL) { if (commit == NULL) {
error = git_iterator_for_nothing(out, &opts); error = git_iterator_for_nothing(out, &opts);
} else if (commit->type == GIT_ANNOTATED_COMMIT_VIRTUAL) { } else if (commit->type == GIT_ANNOTATED_COMMIT_VIRTUAL) {
error = git_iterator_for_index(out, commit->index, &opts); error = git_iterator_for_index(out, git_index_owner(commit->index), commit->index, &opts);
} else { } else {
if (!commit->tree && if (!commit->tree &&
(error = git_commit_tree(&commit->tree, commit->commit)) < 0) (error = git_commit_tree(&commit->tree, commit->commit)) < 0)
...@@ -2682,8 +2682,8 @@ static int merge_check_index(size_t *conflicts, git_repository *repo, git_index ...@@ -2682,8 +2682,8 @@ static int merge_check_index(size_t *conflicts, git_repository *repo, git_index
iter_opts.pathlist.strings = (char **)staged_paths.contents; iter_opts.pathlist.strings = (char **)staged_paths.contents;
iter_opts.pathlist.count = staged_paths.length; iter_opts.pathlist.count = staged_paths.length;
if ((error = git_iterator_for_index(&iter_repo, index_repo, &iter_opts)) < 0 || if ((error = git_iterator_for_index(&iter_repo, repo, index_repo, &iter_opts)) < 0 ||
(error = git_iterator_for_index(&iter_new, index_new, &iter_opts)) < 0 || (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 ||
(error = git_diff__from_iterators(&index_diff_list, repo, iter_repo, iter_new, &opts)) < 0) (error = git_diff__from_iterators(&index_diff_list, repo, iter_repo, iter_new, &opts)) < 0)
goto done; goto done;
...@@ -2759,7 +2759,7 @@ int git_merge__check_result(git_repository *repo, git_index *index_new) ...@@ -2759,7 +2759,7 @@ int git_merge__check_result(git_repository *repo, git_index *index_new)
if ((error = git_repository_head_tree(&head_tree, repo)) < 0 || if ((error = git_repository_head_tree(&head_tree, repo)) < 0 ||
(error = git_iterator_for_tree(&iter_head, head_tree, &iter_opts)) < 0 || (error = git_iterator_for_tree(&iter_head, head_tree, &iter_opts)) < 0 ||
(error = git_iterator_for_index(&iter_new, index_new, &iter_opts)) < 0 || (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 ||
(error = git_diff__from_iterators(&merged_list, repo, iter_head, iter_new, &opts)) < 0) (error = git_diff__from_iterators(&merged_list, repo, iter_head, iter_new, &opts)) < 0)
goto done; goto done;
......
...@@ -550,7 +550,7 @@ int git_pathspec_match_index( ...@@ -550,7 +550,7 @@ int git_pathspec_match_index(
iter_opts.flags = pathspec_match_iter_flags(flags); iter_opts.flags = pathspec_match_iter_flags(flags);
if (!(error = git_iterator_for_index(&iter, index, &iter_opts))) { if (!(error = git_iterator_for_index(&iter, git_index_owner(index), index, &iter_opts))) {
error = pathspec_match_from_iterator(out, iter, flags, ps); error = pathspec_match_from_iterator(out, iter, flags, ps);
git_iterator_free(iter); git_iterator_free(iter);
} }
...@@ -718,4 +718,3 @@ const char * git_pathspec_match_list_failed_entry( ...@@ -718,4 +718,3 @@ const char * git_pathspec_match_list_failed_entry(
return entry ? *entry : NULL; return entry ? *entry : NULL;
} }
...@@ -685,8 +685,8 @@ static int merge_indexes( ...@@ -685,8 +685,8 @@ static int merge_indexes(
iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE;
if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 || if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 ||
(error = git_iterator_for_index(&ours, ours_index, &iter_opts)) < 0 || (error = git_iterator_for_index(&ours, repo, ours_index, &iter_opts)) < 0 ||
(error = git_iterator_for_index(&theirs, theirs_index, &iter_opts)) < 0) (error = git_iterator_for_index(&theirs, repo, theirs_index, &iter_opts)) < 0)
goto done; goto done;
error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL); error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL);
...@@ -712,7 +712,7 @@ static int merge_index_and_tree( ...@@ -712,7 +712,7 @@ static int merge_index_and_tree(
iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE;
if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 || if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 ||
(error = git_iterator_for_index(&ours, ours_index, &iter_opts)) < 0 || (error = git_iterator_for_index(&ours, repo, ours_index, &iter_opts)) < 0 ||
(error = git_iterator_for_tree(&theirs, theirs_tree, &iter_opts)) < 0) (error = git_iterator_for_tree(&theirs, theirs_tree, &iter_opts)) < 0)
goto done; goto done;
......
...@@ -327,7 +327,7 @@ static int submodules_from_index(git_strmap *map, git_index *idx, git_config *cf ...@@ -327,7 +327,7 @@ static int submodules_from_index(git_strmap *map, git_index *idx, git_config *cf
const git_index_entry *entry; const git_index_entry *entry;
git_buf name = GIT_BUF_INIT; git_buf name = GIT_BUF_INIT;
if ((error = git_iterator_for_index(&i, idx, NULL)) < 0) if ((error = git_iterator_for_index(&i, git_index_owner(idx), idx, NULL)) < 0)
return error; return error;
while (!(error = git_iterator_advance(&entry, i))) { while (!(error = git_iterator_advance(&entry, i))) {
......
...@@ -380,7 +380,7 @@ static void index_iterator_test( ...@@ -380,7 +380,7 @@ static void index_iterator_test(
iter_opts.start = start; iter_opts.start = start;
iter_opts.end = end; iter_opts.end = end;
cl_git_pass(git_iterator_for_index(&i, index, &iter_opts)); cl_git_pass(git_iterator_for_index(&i, repo, index, &iter_opts));
while (!(error = git_iterator_advance(&entry, i))) { while (!(error = git_iterator_advance(&entry, i))) {
cl_assert(entry); cl_assert(entry);
...@@ -974,7 +974,7 @@ static void check_index_range( ...@@ -974,7 +974,7 @@ static void check_index_range(
i_opts.start = start; i_opts.start = start;
i_opts.end = end; i_opts.end = end;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, repo, index, &i_opts));
cl_assert(git_iterator_ignore_case(i) == ignore_case); cl_assert(git_iterator_ignore_case(i) == ignore_case);
......
...@@ -134,19 +134,19 @@ void test_repo_iterator__index(void) ...@@ -134,19 +134,19 @@ void test_repo_iterator__index(void)
cl_git_pass(git_repository_index(&index, g_repo)); cl_git_pass(git_repository_index(&index, g_repo));
/* autoexpand with no tree entries for index */ /* autoexpand with no tree entries for index */
cl_git_pass(git_iterator_for_index(&i, index, NULL)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, NULL));
expect_iterator_items(i, 20, NULL, 20, NULL); expect_iterator_items(i, 20, NULL, 20, NULL);
git_iterator_free(i); git_iterator_free(i);
/* auto expand with tree entries */ /* auto expand with tree entries */
i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; i_opts.flags = GIT_ITERATOR_INCLUDE_TREES;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 22, NULL, 22, NULL); expect_iterator_items(i, 22, NULL, 22, NULL);
git_iterator_free(i); git_iterator_free(i);
/* no auto expand (implies trees included) */ /* no auto expand (implies trees included) */
i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 12, NULL, 22, NULL); expect_iterator_items(i, 12, NULL, 22, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -171,13 +171,13 @@ void test_repo_iterator__index_icase(void) ...@@ -171,13 +171,13 @@ void test_repo_iterator__index_icase(void)
/* autoexpand with no tree entries over range */ /* autoexpand with no tree entries over range */
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 7, NULL, 7, NULL); expect_iterator_items(i, 7, NULL, 7, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 3, NULL, 3, NULL); expect_iterator_items(i, 3, NULL, 3, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -186,13 +186,13 @@ void test_repo_iterator__index_icase(void) ...@@ -186,13 +186,13 @@ void test_repo_iterator__index_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 8, NULL, 8, NULL); expect_iterator_items(i, 8, NULL, 8, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 4, NULL, 4, NULL); expect_iterator_items(i, 4, NULL, 4, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -201,13 +201,13 @@ void test_repo_iterator__index_icase(void) ...@@ -201,13 +201,13 @@ void test_repo_iterator__index_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 5, NULL, 8, NULL); expect_iterator_items(i, 5, NULL, 8, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 1, NULL, 4, NULL); expect_iterator_items(i, 1, NULL, 4, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -219,13 +219,13 @@ void test_repo_iterator__index_icase(void) ...@@ -219,13 +219,13 @@ void test_repo_iterator__index_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 13, NULL, 13, NULL); expect_iterator_items(i, 13, NULL, 13, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 5, NULL, 5, NULL); expect_iterator_items(i, 5, NULL, 5, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -234,13 +234,13 @@ void test_repo_iterator__index_icase(void) ...@@ -234,13 +234,13 @@ void test_repo_iterator__index_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 14, NULL, 14, NULL); expect_iterator_items(i, 14, NULL, 14, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 6, NULL, 6, NULL); expect_iterator_items(i, 6, NULL, 6, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -249,13 +249,13 @@ void test_repo_iterator__index_icase(void) ...@@ -249,13 +249,13 @@ void test_repo_iterator__index_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 9, NULL, 14, NULL); expect_iterator_items(i, 9, NULL, 14, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 1, NULL, 6, NULL); expect_iterator_items(i, 1, NULL, 6, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -1108,14 +1108,14 @@ void test_repo_iterator__indexfilelist(void) ...@@ -1108,14 +1108,14 @@ void test_repo_iterator__indexfilelist(void)
/* All indexfilelist iterator tests are "autoexpand with no tree entries" */ /* All indexfilelist iterator tests are "autoexpand with no tree entries" */
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 8, NULL, 8, NULL); expect_iterator_items(i, 8, NULL, 8, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = NULL; i_opts.end = NULL;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
/* (c D e k/1 k/a L ==> 6) vs (c e k/1 k/a ==> 4) */ /* (c D e k/1 k/a L ==> 6) vs (c e k/1 k/a ==> 4) */
expect = ((default_icase) ? 6 : 4); expect = ((default_icase) ? 6 : 4);
expect_iterator_items(i, expect, NULL, expect, NULL); expect_iterator_items(i, expect, NULL, expect, NULL);
...@@ -1124,7 +1124,7 @@ void test_repo_iterator__indexfilelist(void) ...@@ -1124,7 +1124,7 @@ void test_repo_iterator__indexfilelist(void)
i_opts.start = NULL; i_opts.start = NULL;
i_opts.end = "e"; i_opts.end = "e";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
/* (a B c D e ==> 5) vs (B D L/1 a c e ==> 6) */ /* (a B c D e ==> 5) vs (B D L/1 a c e ==> 6) */
expect = ((default_icase) ? 5 : 6); expect = ((default_icase) ? 5 : 6);
expect_iterator_items(i, expect, NULL, expect, NULL); expect_iterator_items(i, expect, NULL, expect, NULL);
...@@ -1166,7 +1166,7 @@ void test_repo_iterator__indexfilelist_2(void) ...@@ -1166,7 +1166,7 @@ void test_repo_iterator__indexfilelist_2(void)
/* (c D e k/1 k/a ==> 5) vs (c e k/1 ==> 3) */ /* (c D e k/1 k/a ==> 5) vs (c e k/1 ==> 3) */
expect = default_icase ? 5 : 3; expect = default_icase ? 5 : 3;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, expect, NULL, expect, NULL); expect_iterator_items(i, expect, NULL, expect, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -1208,7 +1208,7 @@ void test_repo_iterator__indexfilelist_3(void) ...@@ -1208,7 +1208,7 @@ void test_repo_iterator__indexfilelist_3(void)
/* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */ /* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */
expect = default_icase ? 8 : 5; expect = default_icase ? 8 : 5;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, expect, NULL, expect, NULL); expect_iterator_items(i, expect, NULL, expect, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -1250,7 +1250,7 @@ void test_repo_iterator__indexfilelist_4(void) ...@@ -1250,7 +1250,7 @@ void test_repo_iterator__indexfilelist_4(void)
/* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */ /* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */
expect = default_icase ? 8 : 5; expect = default_icase ? 8 : 5;
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, expect, NULL, expect, NULL); expect_iterator_items(i, expect, NULL, expect, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -1291,13 +1291,13 @@ void test_repo_iterator__indexfilelist_icase(void) ...@@ -1291,13 +1291,13 @@ void test_repo_iterator__indexfilelist_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 3, NULL, 3, NULL); expect_iterator_items(i, 3, NULL, 3, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 1, NULL, 1, NULL); expect_iterator_items(i, 1, NULL, 1, NULL);
git_iterator_free(i); git_iterator_free(i);
...@@ -1306,13 +1306,13 @@ void test_repo_iterator__indexfilelist_icase(void) ...@@ -1306,13 +1306,13 @@ void test_repo_iterator__indexfilelist_icase(void)
i_opts.start = "c"; i_opts.start = "c";
i_opts.end = "k/D"; i_opts.end = "k/D";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 5, NULL, 5, NULL); expect_iterator_items(i, 5, NULL, 5, NULL);
git_iterator_free(i); git_iterator_free(i);
i_opts.start = "k"; i_opts.start = "k";
i_opts.end = "k/Z"; i_opts.end = "k/Z";
cl_git_pass(git_iterator_for_index(&i, index, &i_opts)); cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts));
expect_iterator_items(i, 2, NULL, 2, NULL); expect_iterator_items(i, 2, NULL, 2, NULL);
git_iterator_free(i); git_iterator_free(i);
......
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