[PATCH] Add Makefile target glossary.html
[git/dkf.git] / t / t2100-update-cache-badpath.sh
blob86b7375c6c26c51d67b4d4c4d9e6bce278cf5144
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git-update-cache 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-cache --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
33 test_expect_success \
34 'git-update-cache --add to add various paths.' \
35 'git-update-cache --add -- path0 path1 path2/file2 path3/file3'
37 rm -fr path?
39 mkdir path0 path1
40 date >path2
41 ln -s frotz path3
42 date >path0/file0
43 date >path1/file1
45 for p in path0/file0 path1/file1 path2 path3
47 test_expect_failure \
48 "git-update-cache to add conflicting path $p should fail." \
49 "git-update-cache --add -- $p"
50 done
51 test_done