Skip to content

Commit 9814d0a

Browse files
dschogitster
authored andcommitted
mingw: make test_path_is_hidden more robust
This function uses Windows' system tool `attrib` to determine the state of the hidden flag of a file or directory. We should not actually expect the first `attrib.exe` in the PATH to be the one we are looking for. Or that it is in the PATH, for that matter. Let's use the full path to the tool instead. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7c2dfca commit 9814d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/test-lib-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,6 @@ test_bitmap_traversal () {
15471547
# Tests for the hidden file attribute on windows
15481548
is_hidden () {
15491549
# Use the output of `attrib`, ignore the absolute path
1550-
case "$(attrib "$1")" in *H*?:*) return 0;; esac
1550+
case "$("$SYSTEMROOT"/system32/attrib "$1")" in *H*?:*) return 0;; esac
15511551
return 1
15521552
}

0 commit comments

Comments
 (0)