From 8e4aae1ae5f9f023641ab4046dfee6c744e58e13 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Tue, 31 Jul 2012 10:44:42 -0700 Subject: Checkout: handle file modes properly. Global file mode override now works properly with the file mode stored in the tree node. --- tests-clar/checkout/checkout.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests-clar/checkout') diff --git a/tests-clar/checkout/checkout.c b/tests-clar/checkout/checkout.c index 1e777e04..5099c4e1 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}; -- cgit v1.2.1