diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-01-13 11:22:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-01-13 11:22:48 -0800 |
commit | ada6ebb6e9525d6cd0ce954edc04123d15a8650b (patch) | |
tree | d94e64edf1f0f163a1da5ce017f9c5ad3ed0154b /t | |
parent | Merge branch 'jk/rev-parse-double-dashes' into maint (diff) | |
parent | mv: let 'git mv file no-such-dir/' error out on Windows, too (diff) | |
download | tgif-ada6ebb6e9525d6cd0ce954edc04123d15a8650b.tar.xz |
Merge branch 'mm/mv-file-to-no-such-dir-with-slash' into maint
"git mv A B/", when B does not exist as a directory, should error
out, but it didn't.
* mm/mv-file-to-no-such-dir-with-slash:
mv: let 'git mv file no-such-dir/' error out on Windows, too
mv: let 'git mv file no-such-dir/' error out
Diffstat (limited to 't')
-rwxr-xr-x | t/t7001-mv.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index b90e985a48..3bfdfed1f7 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -70,6 +70,35 @@ test_expect_success \ rm -f idontexist untracked1 untracked2 \ path0/idontexist path0/untracked1 path0/untracked2 \ .git/index.lock +rmdir path1 + +test_expect_success \ + 'moving to absent target with trailing slash' \ + 'test_must_fail git mv path0/COPYING no-such-dir/ && + test_must_fail git mv path0/COPYING no-such-dir// && + git mv path0/ no-such-dir/ && + test_path_is_dir no-such-dir' + +test_expect_success \ + 'clean up' \ + 'git reset --hard' + +test_expect_success \ + 'moving to existing untracked target with trailing slash' \ + 'mkdir path1 && + git mv path0/ path1/ && + test_path_is_dir path1/path0/' + +test_expect_success \ + 'moving to existing tracked target with trailing slash' \ + 'mkdir path2 && + >path2/file && git add path2/file && + git mv path1/path0/ path2/ && + test_path_is_dir path2/path0/' + +test_expect_success \ + 'clean up' \ + 'git reset --hard' test_expect_success \ 'adding another file' \ |