summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-10-09 09:08:19 +0200
committerPatrick Steinhardt <ps@pks.im>2017-10-09 09:13:51 +0200
commit09c15a7fc920f50b23669ededaa7b19fd045e266 (patch)
treecb6b0089f883ad70d67d6b5c843678cdb5cf3514
parent880dfc507ea4d19ff4d30a04b2d94617a91d34d6 (diff)
downloadlibgit2-09c15a7fc920f50b23669ededaa7b19fd045e266.tar.gz
tests: checkout::tree: check that the status list catches mode changes
While we verify that we have no mode changes after calling `git_checkout_tree`, we do not verify that the `p_chmod` calls actually resulted in a changed entry. While we should assume that this works due to separate tests for the status list, we should test for the change being listed to avoid programming errors in the test.
-rw-r--r--tests/checkout/tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index d7e756914..56513eab7 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -1541,6 +1541,7 @@ void test_checkout_tree__mode_change_is_force_updated(void)
/* update the mode on-disk */
cl_must_pass(p_chmod("testrepo/README", 0755));
+ assert_status_entrycount(g_repo, 1);
cl_git_pass(git_checkout_tree(g_repo, obj, &g_opts));
assert_status_entrycount(g_repo, 0);
@@ -1548,6 +1549,7 @@ void test_checkout_tree__mode_change_is_force_updated(void)
cl_must_pass(p_chmod("testrepo/README", 0755));
cl_must_pass(git_index_add_bypath(index, "README"));
+ assert_status_entrycount(g_repo, 1);
cl_git_pass(git_checkout_tree(g_repo, obj, &g_opts));
assert_status_entrycount(g_repo, 0);