diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 675773479a..5bacf2278c 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -310,4 +310,32 @@ test_expect_success POSIXPERM 'init notices EPERM' ' ) ' +# Tests for the hidden file attribute on windows +is_hidden () { + test "1" -eq "$(echo puts [file attributes $1 -hidden]|tclsh)" +} + +test_expect_success MINGW 'plain hidden' ' + rm -rf newdir && + ( + unset GIT_DIR GIT_WORK_TREE + mkdir newdir && + cd newdir && + git init && + is_hidden .git + ) && + check_config newdir/.git false unset +' + +test_expect_success MINGW 'plain bare not hidden' ' + rm -rf newdir + ( + unset GIT_DIR GIT_WORK_TREE GIT_CONFIG + mkdir newdir && + cd newdir && + git --bare init + ) && + ! is_hidden newdir +' + test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 80f6a52ccc..f25709854a 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -793,6 +793,7 @@ case $(uname -s) in # no POSIX permissions # backslashes in pathspec are converted to '/' # exec does not inherit the PID + test_set_prereq MINGW ;; *) test_set_prereq POSIXPERM