@matheusbsbs / matheus-bagliano / commits / 3772923f14
Fork 0

add test cases for "git mv -k"

Add test cases for ignoring nonexisting and untracked files using the -k option to "git mv". There is one known breakage related to multiple untracked files specfied as consecutive arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael J Gruber committed Jan 14, 2009 at 18:03 UTC 3772923f1429f2888074e698c36c071b864effe3
1 file changed +25
t/t7001-mv.sh
+25
@@ -38,6 +38,31 @@ test_expect_success \
38 'git diff-tree -r -M --name-status HEAD^ HEAD | \
39 grep "^R100..*path1/COPYING..*path0/COPYING"'
40
41 +test_expect_success \
42 + 'checking -k on non-existing file' \
43 + 'git mv -k idontexist path0'
44 +
45 +test_expect_success \
46 + 'checking -k on untracked file' \
47 + 'touch untracked1 &&
48 + git mv -k untracked1 path0 &&
49 + test -f untracked1 &&
50 + test ! -f path0/untracked1'
51 +
52 +test_expect_failure \
53 + 'checking -k on multiple untracked files' \
54 + 'touch untracked2 &&
55 + git mv -k untracked1 untracked2 path0 &&
56 + test -f untracked1 &&
57 + test -f untracked2 &&
58 + test ! -f path0/untracked1
59 + test ! -f path0/untracked2'
60 +
61 +# clean up the mess in case bad things happen
62 +rm -f idontexist untracked1 untracked2 \
63 + path0/idontexist path0/untracked1 path0/untracked2 \
64 + .git/index.lock
65 +
66 test_expect_success \
67 'adding another file' \
68 'cp ../../README path0/README &&