diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-08-31 02:25:47 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-08-31 18:48:06 +0300 |
commit | d53c8880696856d695b0979c55136b06e45d6fbb (patch) | |
tree | c79a58c80d3a94f94a77600dfc1dae7ec22011bc /tests/diff | |
parent | 56ed415a24d41e83169ac17f468a540260bd08ff (diff) |
iterator: saner pathlist matching for idx iterator
Some nicer refactoring for index iteration walks.
The index iterator doesn't binary search through the pathlist space,
since it lacks directory entries, and would have to binary search
each index entry and all its parents (eg, when presented with an index
entry of `foo/bar/file.c`, you would have to look in the pathlist for
`foo/bar/file.c`, `foo/bar` and `foo`). Since the index entries and the
pathlist are both nicely sorted, we walk the index entries in lockstep
with the pathlist like we do for other iteration/diff/merge walks.
Diffstat (limited to 'tests/diff')
-rw-r--r-- | tests/diff/workdir.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c index 336f959f6..e87769170 100644 --- a/tests/diff/workdir.c +++ b/tests/diff/workdir.c @@ -581,30 +581,6 @@ void test_diff_workdir__to_index_with_pathlist_disabling_fnmatch(void) git_diff_free(diff); - /* ensure that multiple trailing slashes are ignored */ - pathspec = "subdir//////"; - - cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - - for (use_iterator = 0; use_iterator <= 1; use_iterator++) { - memset(&exp, 0, sizeof(exp)); - - if (use_iterator) - cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, NULL, NULL, NULL, &exp)); - else - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); - - cl_assert_equal_i(3, exp.files); - cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); - cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); - cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); - cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); - cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); - } - - git_diff_free(diff); - /* ensure that fnmatching is completely disabled */ pathspec = "subdir/*"; |