Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-08-01 20:52:25 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-01 20:52:25 +0300
commitb426ac90a958176131b9ace6a4676bc3ee1ace4d (patch)
treecb4d546333f72bfeb2937d220079430a79fce30b
parent63e5b5512226cfbea24bcf5d74b68cbc89197447 (diff)
index: test that an unregistered submodule gets staged
When we pass the path of a repository to `_bypath()`, we should behave like git and stage it as a `_COMMIT` regardless of whether it is registered a a submodule.
-rw-r--r--tests/index/bypath.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/index/bypath.c b/tests/index/bypath.c
index b587a9ce8..9706a8833 100644
--- a/tests/index/bypath.c
+++ b/tests/index/bypath.c
@@ -34,9 +34,15 @@ void test_index_bypath__add_submodule(void)
cl_assert_equal_i(0, status & GIT_SUBMODULE_STATUS_WD_MODIFIED);
}
-void test_index_bypath__add_submodule_old_style(void)
+void test_index_bypath__add_submodule_unregistered(void)
{
const char *sm_name = "not-submodule";
+ const char *sm_head = "68e92c611b80ee1ed8f38314ff9577f0d15b2444";
+ const git_index_entry *entry;
cl_git_pass(git_index_add_bypath(g_idx, sm_name));
+
+ cl_assert(entry = git_index_get_bypath(g_idx, sm_name, 0));
+ cl_assert_equal_s(sm_head, git_oid_tostr_s(&entry->id));
+ cl_assert_equal_s(sm_name, entry->path);
}