mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
mingw: add tests for the hidden attribute on the git directory
With msysGit the .git directory is supposed to be hidden, unless it is a bare git repository. Test this. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
This commit is contained in:
committed by
Johannes Schindelin
parent
2d3884a022
commit
bf5f382347
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user