]> Pileus Git - ~andy/git/blobdiff - t/t0001-init.sh
init: handle empty "template" parameter
[~andy/git] / t / t0001-init.sh
index d31887f9bf35a7fa9e31b1eb859a9cf21c918d6c..c0b781ae49af6cdc8a9bcc4a551310637366eb8f 100755 (executable)
@@ -141,4 +141,30 @@ test_expect_success 'reinit' '
        test_cmp again/empty again/err2
 '
 
+test_expect_success 'init with --template' '
+       mkdir template-source &&
+       echo content >template-source/file &&
+       (
+               mkdir template-custom &&
+               cd template-custom &&
+               git init --template=../template-source
+       ) &&
+       test_cmp template-source/file template-custom/.git/file
+'
+
+test_expect_success 'init with --template (blank)' '
+       (
+               mkdir template-plain &&
+               cd template-plain &&
+               git init
+       ) &&
+       test -f template-plain/.git/info/exclude &&
+       (
+               mkdir template-blank &&
+               cd template-blank &&
+               git init --template=
+       ) &&
+       ! test -f template-blank/.git/info/exclude
+'
+
 test_done