@matheusbsbs / matheus-bagliano / commits / 704a3143d5
Fork 0

Use prerequisite tags to skip tests that depend on symbolic links

Many tests depend on that symbolic links work. This introduces a check that sets the prerequisite tag SYMLINKS if the file system supports symbolic links. Since so many tests have to check for this prerequisite, we do the check in test-lib.sh, so that we don't need to repeat the test in many scripts. To check for 'ln -s' failures, you can use a FAT partition on Linux: $ mkdosfs -C git-on-fat 1000000 $ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt Clone git to /mnt and $ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7 t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \ make test (These additionally skipped tests depend on POSIX permissions that FAT on Linux does not provide.) Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Johannes Sixt committed Mar 4, 2009 at 22:38 UTC 704a3143d5ba0709727430154ef3dad600aad4de
32 files changed +211 -76
t/t0000-basic.sh
+31 -12
@@ -115,12 +115,31 @@ test_expect_success \
115 'test "$tree" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904'
116
117 # Various types of objects
118 +# Some filesystems do not support symblic links; on such systems
119 +# some expected values are different
120 mkdir path2 path3 path3/subp3
119 -for p in path0 path2/file2 path3/file3 path3/subp3/file3
121 +paths='path0 path2/file2 path3/file3 path3/subp3/file3'
122 +for p in $paths
123 do
124 echo "hello $p" >$p
122 - ln -s "hello $p" ${p}sym
125 done
126 +if test_have_prereq SYMLINKS
127 +then
128 + for p in $paths
129 + do
130 + ln -s "hello $p" ${p}sym
131 + done
132 + expectfilter=cat
133 + expectedtree=087704a96baf1c2d1c869a8b084481e121c88b5b
134 + expectedptree1=21ae8269cacbe57ae09138dcc3a2887f904d02b3
135 + expectedptree2=3c5e5399f3a333eddecce7a9b9465b63f65f51e2
136 +else
137 + expectfilter='grep -v sym'
138 + expectedtree=8e18edf7d7edcf4371a3ac6ae5f07c2641db7c46
139 + expectedptree1=cfb8591b2f65de8b8cc1020cd7d9e67e7793b325
140 + expectedptree2=ce580448f0148b985a513b693fdf7d802cacb44f
141 +fi
142 +
143 test_expect_success \
144 'adding various types of objects with git update-index --add.' \
145 'find path* ! -type d -print | xargs git update-index --add'
@@ -130,7 +149,7 @@ test_expect_success \
149 'showing stage with git ls-files --stage' \
150 'git ls-files --stage >current'
151
133 -cat >expected <<\EOF
152 +$expectfilter >expected <<\EOF
153 100644 f87290f8eb2cbbea7857214459a0739927eab154 0 path0
154 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0 path0sym
155 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0 path2/file2
@@ -149,7 +168,7 @@ test_expect_success \
168 'tree=$(git write-tree)'
169 test_expect_success \
170 'validate object ID for a known tree.' \
152 - 'test "$tree" = 087704a96baf1c2d1c869a8b084481e121c88b5b'
171 + 'test "$tree" = "$expectedtree"'
172
173 test_expect_success \
174 'showing tree with git ls-tree' \
@@ -160,7 +179,7 @@ cat >expected <<\EOF
179 040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe path2
180 040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3 path3
181 EOF
163 -test_expect_success \
182 +test_expect_success SYMLINKS \
183 'git ls-tree output for a known tree.' \
184 'test_cmp expected current'
185
@@ -169,7 +188,7 @@ test_expect_success \
188 test_expect_success \
189 'showing tree with git ls-tree -r' \
190 'git ls-tree -r $tree >current'
172 -cat >expected <<\EOF
191 +$expectfilter >expected <<\EOF
192 100644 blob f87290f8eb2cbbea7857214459a0739927eab154 path0
193 120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01 path0sym
194 100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 path2/file2
@@ -200,7 +219,7 @@ cat >expected <<\EOF
219 100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f path3/subp3/file3
220 120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c path3/subp3/file3sym
221 EOF
203 -test_expect_success \
222 +test_expect_success SYMLINKS \
223 'git ls-tree -r output for a known tree.' \
224 'test_cmp expected current'
225
@@ -209,14 +228,14 @@ test_expect_success \
228 'ptree=$(git write-tree --prefix=path3)'
229 test_expect_success \
230 'validate object ID for a known tree.' \
212 - 'test "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3'
231 + 'test "$ptree" = "$expectedptree1"'
232
233 test_expect_success \
234 'writing partial tree out with git write-tree --prefix.' \
235 'ptree=$(git write-tree --prefix=path3/subp3)'
236 test_expect_success \
237 'validate object ID for a known tree.' \
219 - 'test "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2'
238 + 'test "$ptree" = "$expectedptree2"'
239
240 cat >badobjects <<EOF
241 100644 blob 1000000000000000000000000000000000000000 dir/file1
@@ -249,7 +268,7 @@ test_expect_success \
268 newtree=$(git write-tree) &&
269 test "$newtree" = "$tree"'
270
252 -cat >expected <<\EOF
271 +$expectfilter >expected <<\EOF
272 :100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M path0
273 :120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M path0sym
274 :100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M path2/file2
@@ -272,7 +291,7 @@ test_expect_success \
291 'git diff-files >current && cmp -s current /dev/null'
292
293 ################################################################
275 -P=087704a96baf1c2d1c869a8b084481e121c88b5b
294 +P=$expectedtree
295 test_expect_success \
296 'git commit-tree records the correct tree in a commit.' \
297 'commit0=$(echo NO | git commit-tree $P) &&
@@ -308,7 +327,7 @@ test_expect_success 'update-index D/F conflict' '
327 test $numpath0 = 1
328 '
329
311 -test_expect_success 'absolute path works as expected' '
330 +test_expect_success SYMLINKS 'absolute path works as expected' '
331 mkdir first &&
332 ln -s ../.git first/.git &&
333 mkdir second &&
t/t0055-beyond-symlinks.sh
+3 -3
@@ -4,7 +4,7 @@ test_description='update-index and add refuse to add beyond symlinks'
4
5 . ./test-lib.sh
6
7 -test_expect_success setup '
7 +test_expect_success SYMLINKS setup '
8 >a &&
9 mkdir b &&
10 ln -s b c &&
@@ -12,12 +12,12 @@ test_expect_success setup '
12 git update-index --add a b/d
13 '
14
15 -test_expect_success 'update-index --add beyond symlinks' '
15 +test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
16 test_must_fail git update-index --add c/d &&
17 ! ( git ls-files | grep c/d )
18 '
19
20 -test_expect_success 'add beyond symlinks' '
20 +test_expect_success SYMLINKS 'add beyond symlinks' '
21 test_must_fail git add c/d &&
22 ! ( git ls-files | grep c/d )
23 '
t/t1004-read-tree-m-u-wf.sh
+3 -3
@@ -157,7 +157,7 @@ test_expect_success '3-way not overwriting local changes (their side)' '
157
158 '
159
160 -test_expect_success 'funny symlink in work tree' '
160 +test_expect_success SYMLINKS 'funny symlink in work tree' '
161
162 git reset --hard &&
163 git checkout -b sym-b side-b &&
@@ -177,7 +177,7 @@ test_expect_success 'funny symlink in work tree' '
177
178 '
179
180 -test_expect_success 'funny symlink in work tree, un-unlink-able' '
180 +test_expect_success SYMLINKS 'funny symlink in work tree, un-unlink-able' '
181
182 rm -fr a b &&
183 git reset --hard &&
@@ -189,7 +189,7 @@ test_expect_success 'funny symlink in work tree, un-unlink-able' '
189 '
190
191 # clean-up from the above test
192 -chmod a+w a
192 +chmod a+w a 2>/dev/null
193 rm -fr a b
194
195 test_expect_success 'D/F setup' '
t/t1020-subdirectory.sh
+1 -1
@@ -126,7 +126,7 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo' '
126 cd foo.git && git show -s HEAD
127 '
128
129 -test_expect_success 'detection should not be fooled by a symlink' '
129 +test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '
130 cd "$HERE" &&
131 rm -fr foo.git &&
132 git clone -s .git another &&
t/t1300-repo-config.sh
+1 -1
@@ -726,7 +726,7 @@ echo >>result
726
727 test_expect_success '--null --get-regexp' 'cmp result expect'
728
729 -test_expect_success 'symlinked configuration' '
729 +test_expect_success SYMLINKS 'symlinked configuration' '
730
731 ln -s notyet myconfig &&
732 GIT_CONFIG=myconfig git config test.frotz nitfol &&
t/t2001-checkout-cache-clash.sh
+3 -3
@@ -59,10 +59,10 @@ test_expect_success \
59 'git read-tree -m $tree1 && git checkout-index -f -a'
60 test_debug 'show_files $tree1'
61
62 -ln -s path0 path1
63 -test_expect_success \
62 +test_expect_success SYMLINKS \
63 'git update-index --add a symlink.' \
65 - 'git update-index --add path1'
64 + 'ln -s path0 path1 &&
65 + git update-index --add path1'
66 test_expect_success \
67 'writing tree out with git write-tree' \
68 'tree3=$(git write-tree)'
t/t2003-checkout-cache-mkdir.sh
+4 -4
@@ -19,7 +19,7 @@ test_expect_success \
19 echo rezrov >path1/file1 &&
20 git update-index --add path0 path1/file1'
21
22 -test_expect_success \
22 +test_expect_success SYMLINKS \
23 'have symlink in place where dir is expected.' \
24 'rm -fr path0 path1 &&
25 mkdir path2 &&
@@ -59,7 +59,7 @@ test_expect_success \
59 test ! -f path1/file1'
60
61 # Linus fix #1
62 -test_expect_success \
62 +test_expect_success SYMLINKS \
63 'use --prefix=tmp/orary/ where tmp is a symlink' \
64 'rm -fr path0 path1 path2 tmp* &&
65 mkdir tmp1 tmp1/orary &&
@@ -71,7 +71,7 @@ test_expect_success \
71 test -h tmp'
72
73 # Linus fix #2
74 -test_expect_success \
74 +test_expect_success SYMLINKS \
75 'use --prefix=tmp/orary- where tmp is a symlink' \
76 'rm -fr path0 path1 path2 tmp* &&
77 mkdir tmp1 &&
@@ -82,7 +82,7 @@ test_expect_success \
82 test -h tmp'
83
84 # Linus fix #3
85 -test_expect_success \
85 +test_expect_success SYMLINKS \
86 'use --prefix=tmp- where tmp-path1 is a symlink' \
87 'rm -fr path0 path1 path2 tmp* &&
88 mkdir tmp1 &&
t/t2004-checkout-cache-temp.sh
+1 -1
@@ -194,7 +194,7 @@ test_expect_success \
194 test $(cat ../$s1) = tree1asubdir/path5)
195 )'
196
197 -test_expect_success \
197 +test_expect_success SYMLINKS \
198 'checkout --temp symlink' '
199 rm -f path* .merge_* out .git/index &&
200 ln -s b a &&
t/t2007-checkout-symlink.sh
+6
@@ -6,6 +6,12 @@ test_description='git checkout to switch between branches with symlink<->dir'
6
7 . ./test-lib.sh
8
9 +if ! test_have_prereq SYMLINKS
10 +then
11 + say "symbolic links not supported - skipping tests"
12 + test_done
13 +fi
14 +
15 test_expect_success setup '
16
17 mkdir frotz &&
t/t2100-update-cache-badpath.sh
+12 -2
@@ -26,7 +26,12 @@ All of the attempts should fail.
26
27 mkdir path2 path3
28 date >path0
29 -ln -s xyzzy path1
29 +if test_have_prereq SYMLINKS
30 +then
31 + ln -s xyzzy path1
32 +else
33 + date > path1
34 +fi
35 date >path2/file2
36 date >path3/file3
37
@@ -38,7 +43,12 @@ rm -fr path?
43
44 mkdir path0 path1
45 date >path2
41 -ln -s frotz path3
46 +if test_have_prereq SYMLINKS
47 +then
48 + ln -s frotz path3
49 +else
50 + date > path3
51 +fi
52 date >path0/file0
53 date >path1/file1
54
t/t2200-add-update.sh
+1 -1
@@ -80,7 +80,7 @@ test_expect_success 'change gets noticed' '
80
81 '
82
83 -test_expect_success 'replace a file with a symlink' '
83 +test_expect_success SYMLINKS 'replace a file with a symlink' '
84
85 rm foo &&
86 ln -s top foo &&
t/t2201-add-update-typechange.sh
+13 -3
@@ -11,7 +11,13 @@ test_expect_success setup '
11 _empty=$(git hash-object --stdin <xyzzy) &&
12 >yomin &&
13 >caskly &&
14 - ln -s frotz nitfol &&
14 + if test_have_prereq SYMLINKS; then
15 + ln -s frotz nitfol &&
16 + T_letter=T
17 + else
18 + printf %s frotz > nitfol &&
19 + T_letter=M
20 + fi &&
21 mkdir rezrov &&
22 >rezrov/bozbar &&
23 git add caskly xyzzy yomin nitfol rezrov/bozbar &&
@@ -29,7 +35,11 @@ test_expect_success modify '
35 >nitfol &&
36 # rezrov/bozbar disappears
37 rm -fr rezrov &&
32 - ln -s xyzzy rezrov &&
38 + if test_have_prereq SYMLINKS; then
39 + ln -s xyzzy rezrov
40 + else
41 + printf %s xyzzy > rezrov
42 + fi &&
43 # xyzzy disappears (not a submodule)
44 mkdir xyzzy &&
45 echo gnusto >xyzzy/bozbar &&
@@ -71,7 +81,7 @@ test_expect_success modify '
81 s/blob/000000/
82 }
83 / nitfol/{
74 - s/ nitfol/ $_z40 T&/
84 + s/ nitfol/ $_z40 $T_letter&/
85 s/blob/100644/
86 }
87 / rezrov.bozbar/{
t/t2300-cd-to-toplevel.sh
+7 -7
@@ -5,7 +5,7 @@ test_description='cd_to_toplevel'
5 . ./test-lib.sh
6
7 test_cd_to_toplevel () {
8 - test_expect_success "$2" '
8 + test_expect_success $3 "$2" '
9 (
10 cd '"'$1'"' &&
11 . git-sh-setup &&
@@ -24,14 +24,14 @@ test_cd_to_toplevel repo 'at physical root'
24
25 test_cd_to_toplevel repo/sub/dir 'at physical subdir'
26
27 -ln -s repo symrepo
28 -test_cd_to_toplevel symrepo 'at symbolic root'
27 +ln -s repo symrepo 2>/dev/null
28 +test_cd_to_toplevel symrepo 'at symbolic root' SYMLINKS
29
30 -ln -s repo/sub/dir subdir-link
31 -test_cd_to_toplevel subdir-link 'at symbolic subdir'
30 +ln -s repo/sub/dir subdir-link 2>/dev/null
31 +test_cd_to_toplevel subdir-link 'at symbolic subdir' SYMLINKS
32
33 cd repo
34 -ln -s sub/dir internal-link
35 -test_cd_to_toplevel internal-link 'at internal symbolic subdir'
34 +ln -s sub/dir internal-link 2>/dev/null
35 +test_cd_to_toplevel internal-link 'at internal symbolic subdir' SYMLINKS
36
37 test_done
t/t3000-ls-files-others.sh
+6 -1
@@ -17,7 +17,12 @@ filesystem.
17 . ./test-lib.sh
18
19 date >path0
20 -ln -s xyzzy path1
20 +if test_have_prereq SYMLINKS
21 +then
22 + ln -s xyzzy path1
23 +else
24 + date > path1
25 +fi
26 mkdir path2 path3
27 date >path2/file2
28 date >path2-junk
t/t3010-ls-files-killed-modified.sh
+14 -3
@@ -38,7 +38,12 @@ modified without reporting path9 and path10.
38 . ./test-lib.sh
39
40 date >path0
41 -ln -s xyzzy path1
41 +if test_have_prereq SYMLINKS
42 +then
43 + ln -s xyzzy path1
44 +else
45 + date > path1
46 +fi
47 mkdir path2 path3
48 date >path2/file2
49 date >path3/file3
@@ -52,8 +57,14 @@ test_expect_success \
57
58 rm -fr path? ;# leave path10 alone
59 date >path2
55 -ln -s frotz path3
56 -ln -s nitfol path5
60 +if test_have_prereq SYMLINKS
61 +then
62 + ln -s frotz path3
63 + ln -s nitfol path5
64 +else
65 + date > path3
66 + date > path5
67 +fi
68 mkdir path0 path1 path6
69 date >path0/file0
70 date >path1/file1
t/t3100-ls-tree-restrict.sh
+26 -14
@@ -22,9 +22,21 @@ test_expect_success \
22 'setup' \
23 'mkdir path2 path2/baz &&
24 echo Hi >path0 &&
25 - ln -s path0 path1 &&
25 + if test_have_prereq SYMLINKS
26 + then
27 + ln -s path0 path1 &&
28 + ln -s ../path1 path2/bazbo
29 + make_expected () {
30 + cat >expected
31 + }
32 + else
33 + printf path0 > path1 &&
34 + printf ../path1 > path2/bazbo
35 + make_expected () {
36 + sed -e "s/120000 /100644 /" >expected
37 + }
38 + fi &&
39 echo Lo >path2/foo &&
27 - ln -s ../path1 path2/bazbo &&
40 echo Mi >path2/baz/b &&
41 find path? \( -type f -o -type l \) -print |
42 xargs git update-index --add &&
@@ -41,7 +53,7 @@ test_output () {
53 test_expect_success \
54 'ls-tree plain' \
55 'git ls-tree $tree >current &&
44 - cat >expected <<\EOF &&
56 + make_expected <<\EOF &&
57 100644 blob X path0
58 120000 blob X path1
59 040000 tree X path2
@@ -51,7 +63,7 @@ EOF
63 test_expect_success \
64 'ls-tree recursive' \
65 'git ls-tree -r $tree >current &&
54 - cat >expected <<\EOF &&
66 + make_expected <<\EOF &&
67 100644 blob X path0
68 120000 blob X path1
69 100644 blob X path2/baz/b
@@ -63,7 +75,7 @@ EOF
75 test_expect_success \
76 'ls-tree recursive with -t' \
77 'git ls-tree -r -t $tree >current &&
66 - cat >expected <<\EOF &&
78 + make_expected <<\EOF &&
79 100644 blob X path0
80 120000 blob X path1
81 040000 tree X path2
@@ -77,7 +89,7 @@ EOF
89 test_expect_success \
90 'ls-tree recursive with -d' \
91 'git ls-tree -r -d $tree >current &&
80 - cat >expected <<\EOF &&
92 + make_expected <<\EOF &&
93 040000 tree X path2
94 040000 tree X path2/baz
95 EOF
@@ -86,7 +98,7 @@ EOF
98 test_expect_success \
99 'ls-tree filtered with path' \
100 'git ls-tree $tree path >current &&
89 - cat >expected <<\EOF &&
101 + make_expected <<\EOF &&
102 EOF
103 test_output'
104
@@ -96,7 +108,7 @@ EOF
108 test_expect_success \
109 'ls-tree filtered with path1 path0' \
110 'git ls-tree $tree path1 path0 >current &&
99 - cat >expected <<\EOF &&
111 + make_expected <<\EOF &&
112 100644 blob X path0
113 120000 blob X path1
114 EOF
@@ -105,7 +117,7 @@ EOF
117 test_expect_success \
118 'ls-tree filtered with path0/' \
119 'git ls-tree $tree path0/ >current &&
108 - cat >expected <<\EOF &&
120 + make_expected <<\EOF &&
121 EOF
122 test_output'
123
@@ -114,7 +126,7 @@ EOF
126 test_expect_success \
127 'ls-tree filtered with path2' \
128 'git ls-tree $tree path2 >current &&
117 - cat >expected <<\EOF &&
129 + make_expected <<\EOF &&
130 040000 tree X path2
131 EOF
132 test_output'
@@ -123,7 +135,7 @@ EOF
135 test_expect_success \
136 'ls-tree filtered with path2/' \
137 'git ls-tree $tree path2/ >current &&
126 - cat >expected <<\EOF &&
138 + make_expected <<\EOF &&
139 040000 tree X path2/baz
140 120000 blob X path2/bazbo
141 100644 blob X path2/foo
@@ -135,7 +147,7 @@ EOF
147 test_expect_success \
148 'ls-tree filtered with path2/baz' \
149 'git ls-tree $tree path2/baz >current &&
138 - cat >expected <<\EOF &&
150 + make_expected <<\EOF &&
151 040000 tree X path2/baz
152 EOF
153 test_output'
@@ -143,14 +155,14 @@ EOF
155 test_expect_success \
156 'ls-tree filtered with path2/bak' \
157 'git ls-tree $tree path2/bak >current &&
146 - cat >expected <<\EOF &&
158 + make_expected <<\EOF &&
159 EOF
160 test_output'
161
162 test_expect_success \
163 'ls-tree -t filtered with path2/bak' \
164 'git ls-tree -t $tree path2/bak >current &&
153 - cat >expected <<\EOF &&
165 + make_expected <<\EOF &&
166 040000 tree X path2
167 EOF
168 test_output'
t/t3200-branch.sh
+1 -1
@@ -121,7 +121,7 @@ test_expect_success 'renaming a symref is not allowed' \
121 ! test -f .git/refs/heads/master3
122 '
123
124 -test_expect_success \
124 +test_expect_success SYMLINKS \
125 'git branch -m u v should fail when the reflog for u is a symlink' '
126 git branch -l u &&
127 mv .git/logs/refs/heads/u real-u &&
t/t3700-add.sh
+3 -3
@@ -30,7 +30,7 @@ test_expect_success \
30 *) echo fail; git ls-files --stage xfoo1; (exit 1);;
31 esac'
32
33 -test_expect_success 'git add: filemode=0 should not get confused by symlink' '
33 +test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '
34 rm -f xfoo1 &&
35 ln -s foo xfoo1 &&
36 git add xfoo1 &&
@@ -51,7 +51,7 @@ test_expect_success \
51 *) echo fail; git ls-files --stage xfoo2; (exit 1);;
52 esac'
53
54 -test_expect_success 'git add: filemode=0 should not get confused by symlink' '
54 +test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '
55 rm -f xfoo2 &&
56 ln -s foo xfoo2 &&
57 git update-index --add xfoo2 &&
@@ -61,7 +61,7 @@ test_expect_success 'git add: filemode=0 should not get confused by symlink' '
61 esac
62 '
63
64 -test_expect_success \
64 +test_expect_success SYMLINKS \
65 'git update-index --add: Test that executable bit is not used...' \
66 'git config core.filemode 0 &&
67 ln -s xfoo2 xfoo3 &&
t/t4004-diff-rename-symlink.sh
+7
@@ -12,6 +12,13 @@ by an edit for them.
12 . ./test-lib.sh
13 . "$TEST_DIRECTORY"/diff-lib.sh
14
15 +if ! test_have_prereq SYMLINKS
16 +then
17 + say 'Symbolic links not supported, skipping tests.'
18 + test_done
19 + exit
20 +fi
21 +
22 test_expect_success \
23 'prepare reference tree' \
24 'echo xyzzy | tr -d '\\\\'012 >yomin &&
t/t4008-diff-break-rewrite.sh
+4 -4
@@ -99,7 +99,7 @@ test_expect_success \
99 'validate result of -B -M (#4)' \
100 'compare_diff_raw expected current'
101
102 -test_expect_success \
102 +test_expect_success SYMLINKS \
103 'make file0 into something completely different' \
104 'rm -f file0 &&
105 ln -s frotz file0 &&
@@ -114,7 +114,7 @@ cat >expected <<\EOF
114 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1
115 EOF
116
117 -test_expect_success \
117 +test_expect_success SYMLINKS \
118 'validate result of -B (#5)' \
119 'compare_diff_raw expected current'
120
@@ -129,7 +129,7 @@ cat >expected <<\EOF
129 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R file0 file1
130 EOF
131
132 -test_expect_success \
132 +test_expect_success SYMLINKS \
133 'validate result of -B -M (#6)' \
134 'compare_diff_raw expected current'
135
@@ -144,7 +144,7 @@ cat >expected <<\EOF
144 :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M file1
145 EOF
146
147 -test_expect_success \
147 +test_expect_success SYMLINKS \
148 'validate result of -M (#7)' \
149 'compare_diff_raw expected current'
150
t/t4011-diff-symlink.sh
+7
@@ -9,6 +9,13 @@ test_description='Test diff of symlinks.
9 . ./test-lib.sh
10 . "$TEST_DIRECTORY"/diff-lib.sh
11
12 +if ! test_have_prereq SYMLINKS
13 +then
14 + say 'Symbolic links not supported, skipping tests.'
15 + test_done
16 + exit
17 +fi
18 +
19 cat > expected << EOF
20 diff --git a/frotz b/frotz
21 new file mode 120000
t/t4023-diff-rename-typechange.sh
+7
@@ -4,6 +4,13 @@ test_description='typechange rename detection'
4
5 . ./test-lib.sh
6
7 +if ! test_have_prereq SYMLINKS
8 +then
9 + say 'Symbolic links not supported, skipping tests.'
10 + test_done
11 + exit
12 +fi
13 +
14 test_expect_success setup '
15
16 rm -f foo bar &&
t/t4114-apply-typechange.sh
+7
@@ -9,6 +9,13 @@ test_description='git apply should not get confused with type changes.
9
10 . ./test-lib.sh
11
12 +if ! test_have_prereq SYMLINKS
13 +then
14 + say 'Symbolic links not supported, skipping tests.'
15 + test_done
16 + exit
17 +fi
18 +
19 test_expect_success 'setup repository and commits' '
20 echo "hello world" > foo &&
21 echo "hi planet" > bar &&
t/t4115-apply-symlink.sh
+7
@@ -9,6 +9,13 @@ test_description='git apply symlinks and partial files
9
10 . ./test-lib.sh
11
12 +if ! test_have_prereq SYMLINKS
13 +then
14 + say 'Symbolic links not supported, skipping tests.'
15 + test_done
16 + exit
17 +fi
18 +
19 test_expect_success setup '
20
21 ln -s path1/path2/path3/path4/path5 link1 &&
t/t4122-apply-symlink-inside.sh
+7
@@ -3,6 +3,13 @@
3 test_description='apply to deeper directory without getting fooled with symlink'
4 . ./test-lib.sh
5
6 +if ! test_have_prereq SYMLINKS
7 +then
8 + say 'Symbolic links not supported, skipping tests.'
9 + test_done
10 + exit
11 +fi
12 +
13 lecho () {
14 for l_
15 do
t/t5000-tar-tree.sh
+5 -1
@@ -37,7 +37,11 @@ test_expect_success \
37 cp /bin/sh a/bin &&
38 printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
39 printf "A not substituted O" >a/substfile2 &&
40 - ln -s a a/l1 &&
40 + if test_have_prereq SYMLINKS; then
41 + ln -s a a/l1
42 + else
43 + printf %s a > a/l1
44 + fi &&
45 (p=long_path_to_a_file && cd a &&
46 for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&
47 echo text >file_with_long_path) &&
t/t5522-pull-symlink.sh
+7
@@ -4,6 +4,13 @@ test_description='pulling from symlinked subdir'
4
5 . ./test-lib.sh
6
7 +if ! test_have_prereq SYMLINKS
8 +then
9 + say 'Symbolic links not supported, skipping tests.'
10 + test_done
11 + exit
12 +fi
13 +
14 # The scenario we are building:
15 #
16 # trash\ directory/
t/t7001-mv.sh
+2 -2
@@ -206,7 +206,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
206
207 rm -f dirty dirty2
208
209 -test_expect_success 'git mv should overwrite symlink to a file' '
209 +test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '
210
211 rm -fr .git &&
212 git init &&
@@ -225,7 +225,7 @@ test_expect_success 'git mv should overwrite symlink to a file' '
225
226 rm -f moved symlink
227
228 -test_expect_success 'git mv should overwrite file with a symlink' '
228 +test_expect_success SYMLINKS 'git mv should overwrite file with a symlink' '
229
230 rm -fr .git &&
231 git init &&
t/t9131-git-svn-empty-symlink.sh
+1 -1
@@ -88,7 +88,7 @@ test_expect_success 'enable broken symlink workaround' \
88 test_expect_success '"bar" is an empty file' 'test -f x/bar && ! test -s x/bar'
89 test_expect_success 'get "bar" => symlink fix from svn' \
90 '(cd x && git svn rebase)'
91 -test_expect_success '"bar" becomes a symlink' 'test -L x/bar'
91 +test_expect_success SYMLINKS '"bar" becomes a symlink' 'test -L x/bar'
92
93
94 test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" y'
t/t9132-git-svn-broken-symlink.sh
+2 -2
@@ -85,7 +85,7 @@ EOF
85
86 test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x'
87
88 -test_expect_success '"bar" is a symlink that points to "asdf"' '
88 +test_expect_success SYMLINKS '"bar" is a symlink that points to "asdf"' '
89 test -L x/bar &&
90 (cd x && test xasdf = x"`git cat-file blob HEAD:bar`")
91 '
@@ -94,7 +94,7 @@ test_expect_success 'get "bar" => symlink fix from svn' '
94 (cd x && git svn rebase)
95 '
96
97 -test_expect_success '"bar" remains a proper symlink' '
97 +test_expect_success SYMLINKS '"bar" remains a proper symlink' '
98 test -L x/bar &&
99 (cd x && test xdoink = x"`git cat-file blob HEAD:bar`")
100 '
t/t9500-gitweb-standalone-no-errors.sh
+8 -3
@@ -246,7 +246,7 @@ test_expect_success \
246 gitweb_run "p=.git;a=commitdiff"'
247 test_debug 'cat gitweb.log'
248
249 -test_expect_success \
249 +test_expect_success SYMLINKS \
250 'commitdiff(0): file to symlink' \
251 'rm renamed_file &&
252 ln -s file renamed_file &&
@@ -308,7 +308,7 @@ test_debug 'cat gitweb.log'
308 # ----------------------------------------------------------------------
309 # commitdiff testing (taken from t4114-apply-typechange.sh)
310
311 -test_expect_success 'setup typechange commits' '
311 +test_expect_success SYMLINKS 'setup typechange commits' '
312 echo "hello world" > foo &&
313 echo "hi planet" > bar &&
314 git update-index --add foo bar &&
@@ -418,7 +418,12 @@ test_expect_success \
418 git mv 04-rename-from 04-rename-to &&
419 echo "Changed" >> 04-rename-to &&
420 test_chmod +x 05-mode-change &&
421 - rm -f 06-file-or-symlink && ln -s 01-change 06-file-or-symlink &&
421 + rm -f 06-file-or-symlink &&
422 + if test_have_prereq SYMLINKS; then
423 + ln -s 01-change 06-file-or-symlink
424 + else
425 + printf %s 01-change > 06-file-or-symlink
426 + fi &&
427 echo "Changed and have mode changed" > 07-change-mode-change &&
428 test_chmod +x 07-change-mode-change &&
429 git commit -a -m "Large commit" &&
t/test-lib.sh
+4
@@ -689,3 +689,7 @@ case $(uname -s) in
689 }
690 ;;
691 esac
692 +
693 +# test whether the filesystem supports symbolic links
694 +ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
695 +rm -f y