Skip to content

Commit 27a592c

Browse files
patthoytsdscho
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 4288b27 commit 27a592c

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
@@ -354,4 +354,32 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
354354
test_path_is_dir realgitdir/refs
355355
'
356356

357+
# Tests for the hidden file attribute on windows
358+
is_hidden () {
359+
test "1" -eq "$(echo puts [file attributes $1 -hidden]|tclsh)"
360+
}
361+
362+
test_expect_success MINGW 'plain hidden' '
363+
rm -rf newdir &&
364+
(
365+
unset GIT_DIR GIT_WORK_TREE
366+
mkdir newdir &&
367+
cd newdir &&
368+
git init &&
369+
is_hidden .git
370+
) &&
371+
check_config newdir/.git false unset
372+
'
373+
374+
test_expect_success MINGW 'plain bare not hidden' '
375+
rm -rf newdir &&
376+
(
377+
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
378+
mkdir newdir &&
379+
cd newdir &&
380+
git --bare init
381+
) &&
382+
! is_hidden newdir
383+
'
384+
357385
test_done

0 commit comments

Comments
 (0)