summaryrefslogtreecommitdiff
path: root/t/t5611-clone-config.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-17 21:38:39 (GMT)
commitbfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e (patch)
tree4b41f6056f3e599052a554e13269838eb040d807 /t/t5611-clone-config.sh
parent5bfc50d6fe58ec38f55efff43220dc3274b4629b (diff)
parentebf31e70bbea010c9bb505578ae29532445b5a4d (diff)
downloadgit-bfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e.zip
git-bfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e.tar.gz
git-bfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e.tar.bz2
Merge branch 'js/windows-dotgit'
On Windows, .git and optionally any files whose name starts with a dot are now marked as hidden, with a core.hideDotFiles knob to customize this behaviour. * js/windows-dotgit: mingw: remove unnecessary definition mingw: introduce the 'core.hideDotFiles' setting
Diffstat (limited to 't/t5611-clone-config.sh')
-rwxr-xr-xt/t5611-clone-config.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index 27d730c..e4850b7 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -37,4 +37,24 @@ test_expect_success 'clone -c config is available during clone' '
test_cmp expect child/file
'
+# 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
+ return 1
+}
+
+test_expect_success MINGW 'clone -c core.hideDotFiles' '
+ test_commit attributes .gitattributes "" &&
+ rm -rf child &&
+ git clone -c core.hideDotFiles=false . child &&
+ ! is_hidden child/.gitattributes &&
+ rm -rf child &&
+ git clone -c core.hideDotFiles=dotGitOnly . child &&
+ ! is_hidden child/.gitattributes &&
+ rm -rf child &&
+ git clone -c core.hideDotFiles=true . child &&
+ is_hidden child/.gitattributes
+'
+
test_done