summaryrefslogtreecommitdiff
path: root/t/t7001-mv.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7001-mv.sh')
-rwxr-xr-xt/t7001-mv.sh28
1 files changed, 16 insertions, 12 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index bfe2c42..cc3fd2b 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -21,8 +21,8 @@ test_expect_success \
test_expect_success \
'checking the commit' \
- 'git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path0/COPYING..*path1/COPYING"'
+ 'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
+ grep "^R100..*path0/COPYING..*path1/COPYING" actual'
test_expect_success \
'moving the file back into subdirectory' \
@@ -35,8 +35,14 @@ test_expect_success \
test_expect_success \
'checking the commit' \
- 'git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path1/COPYING..*path0/COPYING"'
+ 'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
+ grep "^R100..*path1/COPYING..*path0/COPYING" actual'
+
+test_expect_success \
+ 'mv --dry-run does not move file' \
+ 'git mv -n path0/COPYING MOVED &&
+ test -f path0/COPYING &&
+ test ! -f MOVED'
test_expect_success \
'checking -k on non-existing file' \
@@ -116,10 +122,9 @@ test_expect_success \
test_expect_success \
'checking the commit' \
- 'git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path0/COPYING..*path2/COPYING" &&
- git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path0/README..*path2/README"'
+ 'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
+ grep "^R100..*path0/COPYING..*path2/COPYING" actual &&
+ grep "^R100..*path0/README..*path2/README" actual'
test_expect_success \
'succeed when source is a prefix of destination' \
@@ -135,10 +140,9 @@ test_expect_success \
test_expect_success \
'checking the commit' \
- 'git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path2/COPYING..*path1/path2/COPYING" &&
- git diff-tree -r -M --name-status HEAD^ HEAD | \
- grep "^R100..*path2/README..*path1/path2/README"'
+ 'git diff-tree -r -M --name-status HEAD^ HEAD >actual &&
+ grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual &&
+ grep "^R100..*path2/README..*path1/path2/README" actual'
test_expect_success \
'do not move directory over existing directory' \