]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2100-update-cache-badpath.sh
Fixed misnamed t/t2010-update-cache-badpath.sh
[thirdparty/git.git] / t / t2100-update-cache-badpath.sh
CommitLineData
368f99d5
JH
1#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
6test_description='git-update-cache nonsense-path test.
7
8This test creates the following structure in the cache:
9
10 path0 - a file
11 path1 - a symlink
12 path2/file2 - a file in a directory
13 path3/file3 - a file in a directory
14
15and tries to git-update-cache --add the following:
16
17 path0/file0 - a file in a directory
18 path1/file1 - a file in a directory
19 path2 - a file
20 path3 - a symlink
21
22All of the attempts should fail.
23'
24
25. ./test-lib.sh
26
27mkdir path2 path3
28date >path0
29ln -s xyzzy path1
30date >path2/file2
31date >path3/file3
32
33test_expect_success \
34 'git-update-cache --add to add various paths.' \
35 'git-update-cache --add -- path0 path1 path2/file2 path3/file3'
36
37rm -fr path?
38
39mkdir path0 path1
40date >path2
41ln -s frotz path3
42date >path0/file0
43date >path1/file1
44
45for p in path0/file0 path1/file1 path2 path3
46do
47 test_expect_failure \
48 "git-update-cache to add conflicting path $p should fail." \
49 "git-update-cache --add -- $p"
50done
51test_done