Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 326c9fc

Browse files
committed
checkout test: Apply umask to file-mode test as well
Fix the file-mode test to expect system umask being applied to the created file as well (it is currently applied to the directory only). This fixes the test on systems where umask != 022. Signed-off-by: Michał Górny <[email protected]>
1 parent 15e6a5a commit 326c9fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/checkout/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void test_checkout_index__options_dir_modes(void)
298298

299299
/* File-mode test, since we're on the 'dir' branch */
300300
cl_git_pass(p_stat("./testrepo/a/b.txt", &st));
301-
cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_BLOB_EXECUTABLE, "%07o");
301+
cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_BLOB_EXECUTABLE & ~um, "%07o");
302302

303303
git_commit_free(commit);
304304
}

0 commit comments

Comments
 (0)