Merge branch 'jc/fsck'
[git/gitweb-caching.git] / t / t7001-mv.sh
blob811a4797a58dbc3411f885535b90e6df99f06334
1 #!/bin/sh
3 test_description='git-mv in subdirs'
4 . ./test-lib.sh
6 test_expect_success \
7 'prepare reference tree' \
8 'mkdir path0 path1 &&
9 cp ../../COPYING path0/COPYING &&
10 git-add path0/COPYING &&
11 git-commit -m add -a'
13 test_expect_success \
14 'moving the file out of subdirectory' \
15 'cd path0 && git-mv COPYING ../path1/COPYING'
17 # in path0 currently
18 test_expect_success \
19 'commiting the change' \
20 'cd .. && git-commit -m move-out -a'
22 test_expect_success \
23 'checking the commit' \
24 'git-diff-tree -r -M --name-status HEAD^ HEAD | \
25 grep -E "^R100.+path0/COPYING.+path1/COPYING"'
27 test_expect_success \
28 'moving the file back into subdirectory' \
29 'cd path0 && git-mv ../path1/COPYING COPYING'
31 # in path0 currently
32 test_expect_success \
33 'commiting the change' \
34 'cd .. && git-commit -m move-in -a'
36 test_expect_success \
37 'checking the commit' \
38 'git-diff-tree -r -M --name-status HEAD^ HEAD | \
39 grep -E "^R100.+path1/COPYING.+path0/COPYING"'
41 test_done