File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -392,21 +392,14 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
392
392
test_path_is_dir realgitdir/refs
393
393
'
394
394
395
- # Tests for the hidden file attribute on windows
396
- is_hidden () {
397
- # Use the output of `attrib`, ignore the absolute path
398
- case " $( attrib " $1 " ) " in * H*? :* ) return 0;; esac
399
- return 1
400
- }
401
-
402
395
test_expect_success MINGW ' .git hidden' '
403
396
rm -rf newdir &&
404
397
(
405
398
sane_unset GIT_DIR GIT_WORK_TREE &&
406
399
mkdir newdir &&
407
400
cd newdir &&
408
401
git init &&
409
- is_hidden .git
402
+ test_path_is_hidden .git
410
403
) &&
411
404
check_config newdir/.git false unset
412
405
'
Original file line number Diff line number Diff line change @@ -92,24 +92,17 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
92
92
test_cmp expect actual
93
93
'
94
94
95
- # Tests for the hidden file attribute on windows
96
- is_hidden () {
97
- # Use the output of `attrib`, ignore the absolute path
98
- case " $( attrib " $1 " ) " in * H*? :* ) return 0;; esac
99
- return 1
100
- }
101
-
102
95
test_expect_success MINGW ' clone -c core.hideDotFiles' '
103
96
test_commit attributes .gitattributes "" &&
104
97
rm -rf child &&
105
98
git clone -c core.hideDotFiles=false . child &&
106
- ! is_hidden child/.gitattributes &&
99
+ ! test_path_is_hidden child/.gitattributes &&
107
100
rm -rf child &&
108
101
git clone -c core.hideDotFiles=dotGitOnly . child &&
109
- ! is_hidden child/.gitattributes &&
102
+ ! test_path_is_hidden child/.gitattributes &&
110
103
rm -rf child &&
111
104
git clone -c core.hideDotFiles=true . child &&
112
- is_hidden child/.gitattributes
105
+ test_path_is_hidden child/.gitattributes
113
106
'
114
107
115
108
test_done
Original file line number Diff line number Diff line change @@ -1551,3 +1551,13 @@ test_bitmap_traversal () {
1551
1551
test_cmp " $1 .normalized" " $2 .normalized" &&
1552
1552
rm -f " $1 .normalized" " $2 .normalized"
1553
1553
}
1554
+
1555
+ # Tests for the hidden file attribute on Windows
1556
+ test_path_is_hidden () {
1557
+ test_have_prereq MINGW ||
1558
+ BUG " test_path_is_hidden can only be used on Windows"
1559
+
1560
+ # Use the output of `attrib`, ignore the absolute path
1561
+ case " $( " $SYSTEMROOT " /system32/attrib " $1 " ) " in * H*? :* ) return 0;; esac
1562
+ return 1
1563
+ }
You can’t perform that action at this time.
0 commit comments