3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git checkout-index test.
8 This test registers the following filesystem structure in the
12 path1/file1 - a file in a directory
14 And then tries to checkout in a work tree that has the following:
16 path0/file0 - a file in a directory
19 The git checkout-index command should fail when attempting to checkout
20 path0, finding it is occupied by a directory, and path1/file1, finding
21 path1 is occupied by a non-directory. With "-f" flag, it should remove
22 the conflicting paths and succeed.
31 'git update-index --add various paths.' \
32 'git update-index --add path0 path1/file1'
40 'git checkout-index without -f should fail on conflicting work tree.' \
41 'test_must_fail git checkout-index -a'
44 'git checkout-index with -f should succeed.' \
45 'git checkout-index -f -a'
48 'git checkout-index conflicting paths.' \
49 'test -f path0 && test -d path1 && test -f path1/file1'
51 test_expect_success SYMLINKS 'checkout-index -f twice with --prefix' '
53 ln -s tar/get there &&
55 git checkout-index -a -f --prefix=there/ &&
57 git checkout-index -a -f --prefix=there/