Merge branch 'mr/vcs-svn-printf-ulong'
[gitweb.git] / t / t0001-init.sh
index b4f7c6b363de6a11b1b70f5c6b11482ee5e57c5b..8ffbbea4d65dbd8328563da53ef2959dd39ce796 100755 (executable)
@@ -217,8 +217,8 @@ test_expect_success 'init honors global core.sharedRepository' '
        x$(git config -f shared-honor-global/.git/config core.sharedRepository)
 '
 
-test_expect_success 'init rejects insanely long --template' '
-       test_must_fail git init --template=$(printf "x%09999dx" 1) test
+test_expect_success 'init allows insanely long --template' '
+       git init --template=$(printf "x%09999dx" 1) test
 '
 
 test_expect_success 'init creates a new directory' '
@@ -354,4 +354,43 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
        test_path_is_dir realgitdir/refs
 '
 
+# 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 '.git hidden' '
+       rm -rf newdir &&
+       (
+               unset GIT_DIR GIT_WORK_TREE
+               mkdir newdir &&
+               cd newdir &&
+               git init &&
+               is_hidden .git
+       ) &&
+       check_config newdir/.git false unset
+'
+
+test_expect_success MINGW 'bare git dir not hidden' '
+       rm -rf newdir &&
+       (
+               unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
+               mkdir newdir &&
+               cd newdir &&
+               git --bare init
+       ) &&
+       ! is_hidden newdir
+'
+
+test_expect_success 'remote init from does not use config from cwd' '
+       rm -rf newdir &&
+       test_config core.logallrefupdates true &&
+       git init newdir &&
+       echo true >expect &&
+       git -C newdir config --bool core.logallrefupdates >actual &&
+       test_cmp expect actual
+'
+
 test_done