summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-09-05 16:31:44 -0700
committerRussell Belfer <rb@github.com>2012-09-05 16:31:44 -0700
commit27730eefb9b0b4619006fd7d590bca54c0537090 (patch)
treeba35d3cc1a225c4e7c1e06105dbe3675e544a0d2
parent4d3834038bd0aaef63d62c54900f6ddafec09515 (diff)
parentfed886d9903e377996d7d5f7a7e3f558e4f2b78a (diff)
downloadlibgit2-27730eefb9b0b4619006fd7d590bca54c0537090.tar.gz
Merge pull request #917 from arrbee/test-issue-835
Test for gitmodules only submodule def
-rw-r--r--tests-clar/resources/submod2/gitmodules3
-rw-r--r--tests-clar/submodule/lookup.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/tests-clar/resources/submod2/gitmodules b/tests-clar/resources/submod2/gitmodules
index 7b150b18..4c31108e 100644
--- a/tests-clar/resources/submod2/gitmodules
+++ b/tests-clar/resources/submod2/gitmodules
@@ -19,3 +19,6 @@
[submodule "sm_added_and_uncommited"]
path = sm_added_and_uncommited
url = ../submod2_target
+[submodule "sm_gitmodules_only"]
+ path = sm_gitmodules_only
+ url = ../submod2_target
diff --git a/tests-clar/submodule/lookup.c b/tests-clar/submodule/lookup.c
index 669338f1..94eb19b5 100644
--- a/tests-clar/submodule/lookup.c
+++ b/tests-clar/submodule/lookup.c
@@ -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_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 */
cl_assert(git_submodule_lookup(&sm, g_repo, "not_submodule") == GIT_EEXISTS);
@@ -106,5 +110,5 @@ void test_submodule_lookup__foreach(void)
sm_lookup_data data;
memset(&data, 0, sizeof(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);
}