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

Commit f8b7f55

Browse files
patthoytskblees
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 dbb22e6 commit f8b7f55

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
@@ -332,4 +332,32 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
332332
test_path_is_dir realgitdir/refs
333333
'
334334

335+
# Tests for the hidden file attribute on windows
336+
is_hidden () {
337+
test "1" -eq "$(echo puts [file attributes $1 -hidden]|tclsh)"
338+
}
339+
340+
test_expect_success MINGW 'plain hidden' '
341+
rm -rf newdir &&
342+
(
343+
unset GIT_DIR GIT_WORK_TREE
344+
mkdir newdir &&
345+
cd newdir &&
346+
git init &&
347+
is_hidden .git
348+
) &&
349+
check_config newdir/.git false unset
350+
'
351+
352+
test_expect_success MINGW 'plain bare not hidden' '
353+
rm -rf newdir
354+
(
355+
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
356+
mkdir newdir &&
357+
cd newdir &&
358+
git --bare init
359+
) &&
360+
! is_hidden newdir
361+
'
362+
335363
test_done

0 commit comments

Comments
 (0)