@matheusbsbs / matheus-bagliano / commits / 9814d0a4ad
Fork 0

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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Apr 11, 2020 at 13:40 UTC 9814d0a4ad0f9670b5959939f38dd42f9a7d83b6
1 file changed +1 -1
t/test-lib-functions.sh
+1 -1
@@ -1547,6 +1547,6 @@ test_bitmap_traversal () {
1547 # Tests for the hidden file attribute on windows
1548 is_hidden () {
1549 # 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
1551 return 1
1552 }