pretty: add aliases for pretty formats
[gitweb.git] / t / t0001-init.sh
index 49caa29061a1adb42595aecdb0aed48ff1654883..675773479a8c6a1791ae01eb47654f4433c30ee3 100755 (executable)
@@ -167,6 +167,25 @@ test_expect_success 'init with --template (blank)' '
        ! test -f template-blank/.git/info/exclude
 '
 
+test_expect_success 'init with init.templatedir set' '
+       mkdir templatedir-source &&
+       echo Content >templatedir-source/file &&
+       (
+               HOME="`pwd`" &&
+               export HOME &&
+               test_config="${HOME}/.gitconfig" &&
+               git config -f "$test_config"  init.templatedir "${HOME}/templatedir-source" &&
+               mkdir templatedir-set &&
+               cd templatedir-set &&
+               unset GIT_CONFIG_NOGLOBAL &&
+               unset GIT_TEMPLATE_DIR &&
+               NO_SET_GIT_TEMPLATE_DIR=t &&
+               export NO_SET_GIT_TEMPLATE_DIR &&
+               git init
+       ) &&
+       test_cmp templatedir-source/file templatedir-set/.git/file
+'
+
 test_expect_success 'init --bare/--shared overrides system/global config' '
        (
                HOME="`pwd`" &&
@@ -243,6 +262,12 @@ test_expect_success 'init recreates a new bare directory' '
 '
 
 test_expect_success 'init creates a new deep directory' '
+       rm -fr newdir &&
+       git init newdir/a/b/c &&
+       test -d newdir/a/b/c/.git/refs
+'
+
+test_expect_success POSIXPERM 'init creates a new deep directory (umask vs. shared)' '
        rm -fr newdir &&
        (
                # Leading directories should honor umask while
@@ -251,7 +276,7 @@ test_expect_success 'init creates a new deep directory' '
                git init --bare --shared=0660 newdir/a/b/c &&
                test -d newdir/a/b/c/refs &&
                ls -ld newdir/a newdir/a/b > lsab.out &&
-               ! grep -v "^drwxrw[sx]r-x" ls.out &&
+               ! grep -v "^drwxrw[sx]r-x" lsab.out &&
                ls -ld newdir/a/b/c > lsc.out &&
                ! grep -v "^drwxrw[sx]---" lsc.out
        )