diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-06 16:16:46 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-07 08:33:27 +0100 |
commit | 62a617dc683c1e73eebd0e1b6209f76748e67ed4 (patch) | |
tree | 5893fe2b801d96825582d8a461b50e80f4a2a43a /tests/diff/iterator.c | |
parent | f1a7906fdf0657fba88449bdab07237847f36670 (diff) | |
download | libgit2-cmn/submodule-and-dir.tar.gz |
iterator: submodules are determined by an index or treecmn/submodule-and-dir
We cannot know from looking at .gitmodules whether a directory is a
submodule or not. We need the index or tree we are comparing against to
tell us. Otherwise we have to assume the entry in .gitmodules is stale
or otherwise invalid.
Thus we pass the index of the repository into the workdir iterator, even
if we do not want to compare against it. This follows what git does,
which even for `git diff <tree>`, it will consider staged submodules as
such.
Diffstat (limited to 'tests/diff/iterator.c')
-rw-r--r-- | tests/diff/iterator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/diff/iterator.c b/tests/diff/iterator.c index 26f670cfa..6011c6a9b 100644 --- a/tests/diff/iterator.c +++ b/tests/diff/iterator.c @@ -586,7 +586,7 @@ static void workdir_iterator_test( git_repository *repo = cl_git_sandbox_init(sandbox); cl_git_pass(git_iterator_for_workdir( - &i, repo, GIT_ITERATOR_DONT_AUTOEXPAND, start, end)); + &i, repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, start, end)); error = git_iterator_current(&entry, i); cl_assert((error == 0 && entry != NULL) || @@ -797,7 +797,7 @@ void test_diff_iterator__workdir_builtin_ignores(void) cl_git_mkfile("attr/sub/.git", "whatever"); cl_git_pass(git_iterator_for_workdir( - &i, repo, GIT_ITERATOR_DONT_AUTOEXPAND, "dir", "sub/sub/file")); + &i, repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, "dir", "sub/sub/file")); cl_git_pass(git_iterator_current(&entry, i)); for (idx = 0; entry != NULL; ++idx) { @@ -832,7 +832,7 @@ static void check_wd_first_through_third_range( static const char *expected[] = { "FIRST", "second", "THIRD", NULL }; cl_git_pass(git_iterator_for_workdir( - &i, repo, GIT_ITERATOR_IGNORE_CASE, start, end)); + &i, repo, NULL, NULL, GIT_ITERATOR_IGNORE_CASE, start, end)); cl_git_pass(git_iterator_current(&entry, i)); for (idx = 0; entry != NULL; ++idx) { |