Revert bd2f73a6(Support the tools scripted in perl.)
[git/platforms.git] / t / t2100-update-cache-badpath.sh
blobc222b518a2d6e489fbd174bba24ce2d96202cd88
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git update-index nonsense-path test.
8 This test creates the following structure in the cache:
10 path0 - a file
11 path1 - a symlink
12 path2/file2 - a file in a directory
13 path3/file3 - a file in a directory
15 and tries to git update-index --add the following:
17 path0/file0 - a file in a directory
18 path1/file1 - a file in a directory
19 path2 - a file
20 path3 - a symlink
22 All of the attempts should fail.
25 . ./test-lib.sh
27 mkdir path2 path3
28 date >path0
29 ln -s xyzzy path1
30 date >path2/file2
31 date >path3/file3
32 test "$no_symlinks" && date > path1
34 test_expect_success \
35 'git update-index --add to add various paths.' \
36 'git update-index --add -- path0 path1 path2/file2 path3/file3'
38 rm -fr path?
40 mkdir path0 path1
41 date >path2
42 ln -s frotz path3
43 date >path0/file0
44 date >path1/file1
45 test "$no_symlinks" && date > path3
47 for p in path0/file0 path1/file1 path2 path3
49 test_expect_failure \
50 "git update-index to add conflicting path $p should fail." \
51 "git update-index --add -- $p"
52 done
53 test_done