[PATCH v3 2/3] mingw: make test_path_is_hidden more robust
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 11, 2020, 13:40 UTC
- Message-ID
- <8650936b8d4e975cd5260cfe312cf79b36c2dcc5.1586612423.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.603.v3.git.1586612422.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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> --- t/test-lib-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 7a7e7a38312..2f81463a240 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1547,6 +1547,6 @@ test_bitmap_traversal () { # Tests for the hidden file attribute on windows is_hidden () { # Use the output of `attrib`, ignore the absolute path - case "$(attrib "$1")" in *H*?:*) return 0;; esac + case "$("$SYSTEMROOT"/system32/attrib "$1")" in *H*?:*) return 0;; esac return 1 }
-- gitgitgadget