git-svn: support for git-svn propset
[gitweb.git] / t / t0001-init.sh
index d8c00b44cc8275daffa84af1f6487407eb029c15..7de8d85ee85e2387463e8d98175c9d8f66ca8959 100755 (executable)
@@ -12,6 +12,13 @@ check_config () {
                echo "expected a directory $1, a file $1/config and $1/refs"
                return 1
        fi
+
+       if test_have_prereq POSIXPERM && test -x "$1/config"
+       then
+               echo "$1/config is executable?"
+               return 1
+       fi
+
        bare=$(cd "$1" && git config --bool core.bare)
        worktree=$(cd "$1" && git config core.worktree) ||
        worktree=unset
@@ -24,11 +31,7 @@ check_config () {
 }
 
 test_expect_success 'plain' '
-       (
-               mkdir plain &&
-               cd plain &&
-               git init
-       ) &&
+       git init plain &&
        check_config plain/.git false unset
 '
 
@@ -60,7 +63,7 @@ test_expect_success 'plain through aliased command, outside any git repo' '
        check_config plain-aliased/.git false unset
 '
 
-test_expect_failure 'plain nested through aliased command' '
+test_expect_success 'plain nested through aliased command' '
        (
                git init plain-ancestor-aliased &&
                cd plain-ancestor-aliased &&
@@ -72,7 +75,7 @@ test_expect_failure 'plain nested through aliased command' '
        check_config plain-ancestor-aliased/plain-nested/.git false unset
 '
 
-test_expect_failure 'plain nested in bare through aliased command' '
+test_expect_success 'plain nested in bare through aliased command' '
        (
                git init --bare bare-ancestor-aliased.git &&
                cd bare-ancestor-aliased.git &&
@@ -90,11 +93,7 @@ test_expect_success 'plain with GIT_WORK_TREE' '
 '
 
 test_expect_success 'plain bare' '
-       (
-               mkdir plain-bare-1 &&
-               cd plain-bare-1 &&
-               git --bare init
-       ) &&
+       git --bare init plain-bare-1 &&
        check_config plain-bare-1 true unset
 '
 
@@ -112,12 +111,7 @@ test_expect_success 'GIT_DIR bare' '
 '
 
 test_expect_success 'init --bare' '
-
-       (
-               mkdir init-bare.git &&
-               cd init-bare.git &&
-               git init --bare
-       ) &&
+       git init --bare init-bare.git &&
        check_config init-bare.git true unset
 '
 
@@ -166,26 +160,14 @@ test_expect_success 'reinit' '
 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
-       ) &&
+       git init --template=../template-source template-custom &&
        test_cmp template-source/file template-custom/.git/file
 '
 
 test_expect_success 'init with --template (blank)' '
-       (
-               mkdir template-plain &&
-               cd template-plain &&
-               git init
-       ) &&
+       git init template-plain &&
        test_path_is_file template-plain/.git/info/exclude &&
-       (
-               mkdir template-blank &&
-               cd template-blank &&
-               git init --template=
-       ) &&
+       git init --template= template-blank &&
        test_path_is_missing template-blank/.git/info/exclude
 '
 
@@ -207,34 +189,21 @@ test_expect_success 'init with init.templatedir set' '
 test_expect_success 'init --bare/--shared overrides system/global config' '
        test_config_global core.bare false &&
        test_config_global core.sharedRepository 0640 &&
-       (
-               mkdir init-bare-shared-override &&
-               cd init-bare-shared-override &&
-               git init --bare --shared=0666
-       ) &&
+       git init --bare --shared=0666 init-bare-shared-override &&
        check_config init-bare-shared-override true unset &&
        test x0666 = \
-       x`git config -f init-bare-shared-override/config core.sharedRepository`
+       x$(git config -f init-bare-shared-override/config core.sharedRepository)
 '
 
 test_expect_success 'init honors global core.sharedRepository' '
        test_config_global core.sharedRepository 0666 &&
-       (
-               mkdir shared-honor-global &&
-               cd shared-honor-global &&
-               git init
-       ) &&
+       git init shared-honor-global &&
        test x0666 = \
-       x`git config -f shared-honor-global/.git/config core.sharedRepository`
+       x$(git config -f shared-honor-global/.git/config core.sharedRepository)
 '
 
 test_expect_success 'init rejects insanely long --template' '
-       (
-               insane=$(printf "x%09999dx" 1) &&
-               mkdir test &&
-               cd test &&
-               test_must_fail git init --template=$insane
-       )
+       test_must_fail git init --template=$(printf "x%09999dx" 1) test
 '
 
 test_expect_success 'init creates a new directory' '
@@ -323,7 +292,7 @@ test_expect_success 'init prefers command line to GIT_DIR' '
 test_expect_success 'init with separate gitdir' '
        rm -rf newdir &&
        git init --separate-git-dir realgitdir newdir &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir realgitdir/refs
 '
@@ -337,7 +306,7 @@ test_expect_success 're-init to update git link' '
        cd newdir &&
        git init --separate-git-dir ../surrealgitdir
        ) &&
-       echo "gitdir: `pwd`/surrealgitdir" >expected &&
+       echo "gitdir: $(pwd)/surrealgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir surrealgitdir/refs &&
        test_path_is_missing realgitdir/refs
@@ -350,7 +319,7 @@ test_expect_success 're-init to move gitdir' '
        cd newdir &&
        git init --separate-git-dir ../realgitdir
        ) &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir realgitdir/refs
 '
@@ -364,7 +333,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
        ln -s here .git &&
        git init --separate-git-dir ../realgitdir
        ) &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_cmp expected newdir/here &&
        test_path_is_dir realgitdir/refs