Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit de25266

Browse files
patthoytskasal
authored andcommitted
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 <[email protected]>
1 parent 19c6c09 commit de25266

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/t0001-init.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,32 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
421421
! test -d newdir/here
422422
'
423423

424+
# Tests for the hidden file attribute on windows
425+
is_hidden () {
426+
test "1" -eq "$(echo puts [file attributes $1 -hidden]|tclsh)"
427+
}
428+
429+
test_expect_success MINGW 'plain hidden' '
430+
rm -rf newdir &&
431+
(
432+
unset GIT_DIR GIT_WORK_TREE
433+
mkdir newdir &&
434+
cd newdir &&
435+
git init &&
436+
is_hidden .git
437+
) &&
438+
check_config newdir/.git false unset
439+
'
440+
441+
test_expect_success MINGW 'plain bare not hidden' '
442+
rm -rf newdir
443+
(
444+
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
445+
mkdir newdir &&
446+
cd newdir &&
447+
git --bare init
448+
) &&
449+
! is_hidden newdir
450+
'
451+
424452
test_done

0 commit comments

Comments
 (0)