Code

t7001: add test for git-mv dir1 dir2/
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Wed, 26 Jul 2006 17:41:05 +0000 (19:41 +0200)
committerJunio C Hamano <junkio@cox.net>
Wed, 26 Jul 2006 19:24:49 +0000 (12:24 -0700)
If dir2 already exists, git-mv should move dir1 _into_dir2/.
Noticed by Jon Smirl.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
t/t7001-mv.sh

index d78c56a2eb6f0a11293b6268da4d993c45a2126f..322eaadc730dd022fffe92aba2cba717a3ebe7dc 100755 (executable)
@@ -59,4 +59,19 @@ test_expect_success \
      git-diff-tree -r -M --name-status  HEAD^ HEAD | \
      grep -E "^R100.+path0/README.+path2/README"'
 
+test_expect_success \
+    'moving whole subdirectory into subdirectory' \
+    'git-mv path2 path1'
+
+test_expect_success \
+    'commiting the change' \
+    'git-commit -m dir-move -a'
+
+test_expect_success \
+    'checking the commit' \
+    'git-diff-tree -r -M --name-status  HEAD^ HEAD | \
+     grep -E "^R100.+path2/COPYING.+path1/path2/COPYING" &&
+     git-diff-tree -r -M --name-status  HEAD^ HEAD | \
+     grep -E "^R100.+path2/README.+path1/path2/README"'
+
 test_done