Skip tests that involve symbolic links.
[git/dscho.git] / t / t2300-cd-to-toplevel.sh
blob14416b321004d38158b90765e3973d7bd586ecaa
1 #!/bin/sh
3 test_description='cd_to_toplevel'
5 . ./test-lib.sh
7 test_cd_to_toplevel () {
8 test_expect_success "$2" '
10 cd '"'$1'"' &&
11 . git-sh-setup &&
12 cd_to_toplevel &&
13 [ "$(/bin/pwd)" = "$TOPLEVEL" ]
18 TOPLEVEL="$(/bin/pwd)/repo"
19 mkdir -p repo/sub/dir
20 mv .git repo/
21 SUBDIRECTORY_OK=1
23 test_cd_to_toplevel repo 'at physical root'
25 test_cd_to_toplevel repo/sub/dir 'at physical subdir'
27 if test "$no_symlinks"; then
28 say "symbolic links not supported - skipping tests"
29 else
31 ln -s repo symrepo
32 test_cd_to_toplevel symrepo 'at symbolic root'
34 ln -s repo/sub/dir subdir-link
35 test_cd_to_toplevel subdir-link 'at symbolic subdir'
37 cd repo
38 ln -s sub/dir internal-link
39 test_cd_to_toplevel internal-link 'at internal symbolic subdir'
41 fi # $no_symlinks
43 test_done