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:
Pat Thoyts
2010-03-18 11:48:50 +00:00
committed by Johannes Schindelin
parent 795f156341
commit 689e6d32bc

View File

@@ -417,4 +417,32 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
! test -d newdir/here
'
# 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