Skip to content

Commit 09c15a7

Browse files
committed
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.
1 parent 880dfc5 commit 09c15a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/checkout/tree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,13 +1541,15 @@ void test_checkout_tree__mode_change_is_force_updated(void)
15411541
/* update the mode on-disk */
15421542
cl_must_pass(p_chmod("testrepo/README", 0755));
15431543

1544+
assert_status_entrycount(g_repo, 1);
15441545
cl_git_pass(git_checkout_tree(g_repo, obj, &g_opts));
15451546
assert_status_entrycount(g_repo, 0);
15461547

15471548
/* update the mode on-disk and in the index */
15481549
cl_must_pass(p_chmod("testrepo/README", 0755));
15491550
cl_must_pass(git_index_add_bypath(index, "README"));
15501551

1552+
assert_status_entrycount(g_repo, 1);
15511553
cl_git_pass(git_checkout_tree(g_repo, obj, &g_opts));
15521554
assert_status_entrycount(g_repo, 0);
15531555

0 commit comments

Comments
 (0)