Skip to content

Commit 99c5dca

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge branch 'robustify-is-hidden-tests'
In Git for Windows, there is an option to mark the .git directory as hidden. Our test cases verify this by using the system utility `attrib.exe`. This file name is unfortunately quite generic, and overlaps with a Unix-y utility that might be hiding the system one in the `PATH`. Let's specify explicitly which `attrib` to use. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents b573d78 + 4a01a07 commit 99c5dca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/t0001-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
413413
# Tests for the hidden file attribute on windows
414414
is_hidden () {
415415
# Use the output of `attrib`, ignore the absolute path
416-
case "$(attrib "$1")" in *H*?:*) return 0;; esac
416+
case "$("$SYSTEMROOT"/system32/attrib "$1")" in *H*?:*) return 0;; esac
417417
return 1
418418
}
419419

t/t5611-clone-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
9595
# Tests for the hidden file attribute on windows
9696
is_hidden () {
9797
# Use the output of `attrib`, ignore the absolute path
98-
case "$(attrib "$1")" in *H*?:*) return 0;; esac
98+
case "$("$SYSTEMROOT"/system32/attrib "$1")" in *H*?:*) return 0;; esac
9999
return 1
100100
}
101101

0 commit comments

Comments
 (0)