Imported Upstream version 2.17.5
[platform/upstream/git.git] / t / t5611-clone-config.sh
index 27d730c..39329eb 100755 (executable)
@@ -19,6 +19,14 @@ test_expect_success 'clone -c can set multi-keys' '
        test_cmp expect actual
 '
 
+test_expect_success 'clone -c can set multi-keys, including some empty' '
+       rm -rf child &&
+       git clone -c credential.helper= -c credential.helper=hi . child &&
+       printf "%s\n" "" hi >expect &&
+       git --git-dir=child/.git config --get-all credential.helper >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'clone -c without a value is boolean true' '
        rm -rf child &&
        git clone -c core.foo . child &&
@@ -37,4 +45,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