Thread (8 messages) flat view 8 messages, 5 authors, 2016-06-15
DORMANTno replies

[PATCH 1/2] t7001: add test for git-mv dir1 dir2/

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:34
Subsystem: the rest · Maintainer: Linus Torvalds

If dir2 already exists, git-mv should move dir1 _into_dir2/.
Noticed by Jon Smirl.

Signed-off-by: Johannes Schindelin <redacted>
---

	Jon, this was your problem, right?

 t/t7001-mv.sh |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index d78c56a..322eaad 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -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
-- 
1.4.2.rc2.g96f2-dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help