Code

Merge branch 'jn/maint-fast-import-empty-ls' into maint
[git.git] / t / t5522-pull-symlink.sh
index 86bbd7d024ff6b1ee775ec737c550d54f9371ad7..8e9b204e02a3d204af08463d2229ca0f319cdc42 100755 (executable)
@@ -4,12 +4,6 @@ test_description='pulling from symlinked subdir'
 
 . ./test-lib.sh
 
-if ! test_have_prereq SYMLINKS
-then
-       say 'Symbolic links not supported, skipping tests.'
-       test_done
-fi
-
 # The scenario we are building:
 #
 #   trash\ directory/
@@ -20,17 +14,23 @@ fi
 #
 # The working directory is subdir-link.
 
-mkdir subdir
-echo file >subdir/file
-git add subdir/file
-git commit -q -m file
-git clone -q . clone-repo
-ln -s clone-repo/subdir/ subdir-link
-
+test_expect_success SYMLINKS setup '
+       mkdir subdir &&
+       echo file >subdir/file &&
+       git add subdir/file &&
+       git commit -q -m file &&
+       git clone -q . clone-repo &&
+       ln -s clone-repo/subdir/ subdir-link &&
+       (
+               cd clone-repo &&
+               git config receive.denyCurrentBranch warn
+       ) &&
+       git config receive.denyCurrentBranch warn
+'
 
 # Demonstrate that things work if we just avoid the symlink
 #
-test_expect_success 'pulling from real subdir' '
+test_expect_success SYMLINKS 'pulling from real subdir' '
        (
                echo real >subdir/file &&
                git commit -m real subdir/file &&
@@ -58,7 +58,7 @@ test_expect_success 'pulling from real subdir' '
 # directory.  A POSIX shell's "cd" works a little differently
 # than chdir() in C; "cd -P" is much closer to chdir().
 #
-test_expect_success 'pulling from symlinked subdir' '
+test_expect_success SYMLINKS 'pulling from symlinked subdir' '
        (
                echo link >subdir/file &&
                git commit -m link subdir/file &&
@@ -71,7 +71,7 @@ test_expect_success 'pulling from symlinked subdir' '
 # Prove that the remote end really is a repo, and other commands
 # work fine in this context.  It's just that "git pull" breaks.
 #
-test_expect_success 'pushing from symlinked subdir' '
+test_expect_success SYMLINKS 'pushing from symlinked subdir' '
        (
                cd subdir-link/ &&
                echo push >file &&