summaryrefslogtreecommitdiff
path: root/tests-clar/checkout/checkout.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-31 10:44:42 -0700
committerBen Straub <bstraub@github.com>2012-07-31 10:46:38 -0700
commit8e4aae1ae5f9f023641ab4046dfee6c744e58e13 (patch)
treef7d02ca47a08ccd9a9b473341b97fedf91a3a01c /tests-clar/checkout/checkout.c
parent3f584b5027a6875f4502ab4839e93f80afac95dd (diff)
downloadlibgit2-8e4aae1ae5f9f023641ab4046dfee6c744e58e13.tar.gz
Checkout: handle file modes properly.
Global file mode override now works properly with the file mode stored in the tree node.
Diffstat (limited to 'tests-clar/checkout/checkout.c')
-rw-r--r--tests-clar/checkout/checkout.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests-clar/checkout/checkout.c b/tests-clar/checkout/checkout.c
index 1e777e045..5099c4e16 100644
--- a/tests-clar/checkout/checkout.c
+++ b/tests-clar/checkout/checkout.c
@@ -145,14 +145,18 @@ void test_checkout_checkout__dir_modes(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/dir"));
- opts.dir_mode = 0600;
+ opts.dir_mode = 0701;
cl_git_pass(git_checkout_reference(ref, &opts, NULL));
cl_git_pass(p_stat("./testrepo/a", &st));
- cl_assert_equal_i(st.st_mode & 0777, 0600);
+ cl_assert_equal_i(st.st_mode & 0777, 0701);
+
+ /* File-mode test, since we're on the 'dir' branch */
+ cl_git_pass(p_stat("./testrepo/a/b.txt", &st));
+ cl_assert_equal_i(st.st_mode & 0777, 0755);
#endif
}
-void test_checkout_checkout__file_modes(void)
+void test_checkout_checkout__override_file_modes(void)
{
#ifndef GIT_WIN32
git_checkout_opts opts = {0};