Commit 27730eef by Russell Belfer

Merge pull request #917 from arrbee/test-issue-835

Test for gitmodules only submodule def
parents 4d383403 fed886d9
...@@ -19,3 +19,6 @@ ...@@ -19,3 +19,6 @@
[submodule "sm_added_and_uncommited"] [submodule "sm_added_and_uncommited"]
path = sm_added_and_uncommited path = sm_added_and_uncommited
url = ../submod2_target url = ../submod2_target
[submodule "sm_gitmodules_only"]
path = sm_gitmodules_only
url = ../submod2_target
...@@ -34,6 +34,10 @@ void test_submodule_lookup__simple_lookup(void) ...@@ -34,6 +34,10 @@ void test_submodule_lookup__simple_lookup(void)
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_added_and_uncommited")); cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_added_and_uncommited"));
cl_assert(sm); cl_assert(sm);
/* lookup pending change in .gitmodules that is neither in HEAD nor index */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_gitmodules_only"));
cl_assert(sm);
/* lookup git repo subdir that is not added as submodule */ /* lookup git repo subdir that is not added as submodule */
cl_assert(git_submodule_lookup(&sm, g_repo, "not_submodule") == GIT_EEXISTS); cl_assert(git_submodule_lookup(&sm, g_repo, "not_submodule") == GIT_EEXISTS);
...@@ -106,5 +110,5 @@ void test_submodule_lookup__foreach(void) ...@@ -106,5 +110,5 @@ void test_submodule_lookup__foreach(void)
sm_lookup_data data; sm_lookup_data data;
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
cl_git_pass(git_submodule_foreach(g_repo, sm_lookup_cb, &data)); cl_git_pass(git_submodule_foreach(g_repo, sm_lookup_cb, &data));
cl_assert_equal_i(7, data.count); cl_assert_equal_i(8, data.count);
} }
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