| # Copyright (c) 2005 Junio C Hamano |
| test_description='git-checkout-index test. |
| This test registers the following filesystem structure in the |
| path1/file1 - a file in a directory |
| And then tries to checkout in a work tree that has the following: |
| path0/file0 - a file in a directory |
| The git-checkout-index command should fail when attempting to checkout |
| path0, finding it is occupied by a directory, and path1/file1, finding |
| path1 is occupied by a non-directory. With "-f" flag, it should remove |
| the conflicting paths and succeed. |
| 'git-update-index --add various paths.' \ |
| 'git-update-index --add path0 path1/file1' |
| 'git-checkout-index without -f should fail on conflicting work tree.' \ |
| 'git-checkout-index with -f should succeed.' \ |
| 'git-checkout-index -f -a' |
| 'git-checkout-index conflicting paths.' \ |
| 'test -f path0 && test -d path1 && test -f path1/file1' |