Skip to content

Commit

Permalink
t7001: add test for git-mv dir1 dir2/
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jul 26, 2006
1 parent 4325b4a commit a1dad60
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/t7001-mv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a1dad60

Please sign in to comment.