3 # Copyright (c) 2006 Carl D. Worth
6 test_description
='Test of the various options to git rm.'
10 # Setup some files to be removed, some with funny characters
11 test_expect_success
'Initialize test directory' '
12 touch -- foo bar baz "space embedded" -q &&
13 git add -- foo bar baz "space embedded" -q &&
14 git commit -m "add normal files"
17 if test_have_prereq
!FUNNYNAMES
19 say
'Your filesystem does not allow tabs in filenames.'
22 test_expect_success FUNNYNAMES
'add files with funny names' '
23 touch -- "tab embedded" "newline${LF}embedded" &&
24 git add -- "tab embedded" "newline${LF}embedded" &&
25 git commit -m "add files with tabs and newlines"
28 test_expect_success
'Pre-check that foo exists and is in index before git rm foo' '
29 test_path_is_file foo &&
30 git ls-files --error-unmatch foo
33 test_expect_success
'Test that git rm foo succeeds' '
37 test_expect_success
'Test that git rm --cached foo succeeds if the index matches the file' '
43 test_expect_success
'Test that git rm --cached foo succeeds if the index matches the file' '
47 echo "other content" >foo &&
51 test_expect_success
'Test that git rm --cached foo fails if the index matches neither the file nor HEAD' '
54 git commit -m foo --allow-empty &&
55 echo "other content" >foo &&
57 echo "yet another content" >foo &&
58 test_must_fail git rm --cached foo
61 test_expect_success
'Test that git rm --cached -f foo works in case where --cached only did not' '
64 git commit -m foo --allow-empty &&
65 echo "other content" >foo &&
67 echo "yet another content" >foo &&
68 git rm --cached -f foo
71 test_expect_success
'Post-check that foo exists but is not in index after git rm foo' '
72 test_path_is_file foo &&
73 test_must_fail git ls-files --error-unmatch foo
76 test_expect_success
'Pre-check that bar exists and is in index before "git rm bar"' '
77 test_path_is_file bar &&
78 git ls-files --error-unmatch bar
81 test_expect_success
'Test that "git rm bar" succeeds' '
85 test_expect_success
'Post-check that bar does not exist and is not in index after "git rm -f bar"' '
86 test_path_is_missing bar &&
87 test_must_fail git ls-files --error-unmatch bar
90 test_expect_success
'Test that "git rm -- -q" succeeds (remove a file that looks like an option)' '
94 test_expect_success FUNNYNAMES
'Test that "git rm -f" succeeds with embedded space, tab, or newline characters.' '
95 git rm -f "space embedded" "tab embedded" "newline${LF}embedded"
98 test_expect_success SANITY
'Test that "git rm -f" fails if its rm fails' '
99 test_when_finished "chmod 775 ." &&
101 test_must_fail git rm -f baz
104 test_expect_success
'When the rm in "git rm -f" fails, it should not remove the file from the index' '
105 git ls-files --error-unmatch baz
108 test_expect_success
'Remove nonexistent file with --ignore-unmatch' '
109 git rm --ignore-unmatch nonexistent
112 test_expect_success
'"rm" command printed' '
113 echo frotz >test-file &&
115 git commit -m "add file for rm test" &&
116 git rm test-file >rm-output &&
117 test $(grep "^rm " rm-output | wc -l) = 1 &&
118 rm -f test-file rm-output &&
119 git commit -m "remove file from rm test"
122 test_expect_success
'"rm" command suppressed with --quiet' '
123 echo frotz >test-file &&
125 git commit -m "add file for rm --quiet test" &&
126 git rm --quiet test-file >rm-output &&
127 test_must_be_empty rm-output &&
128 rm -f test-file rm-output &&
129 git commit -m "remove file from rm --quiet test"
132 # Now, failure cases.
133 test_expect_success
'Re-add foo and baz' '
135 git ls-files --error-unmatch foo baz
138 test_expect_success
'Modify foo -- rm should refuse' '
140 test_must_fail git rm foo baz &&
141 test_path_is_file foo &&
142 test_path_is_file baz &&
143 git ls-files --error-unmatch foo baz
146 test_expect_success
'Modified foo -- rm -f should work' '
148 test_path_is_missing foo &&
149 test_path_is_missing baz &&
150 test_must_fail git ls-files --error-unmatch foo &&
151 test_must_fail git ls-files --error-unmatch bar
154 test_expect_success
'Re-add foo and baz for HEAD tests' '
156 git checkout HEAD -- baz &&
158 git ls-files --error-unmatch foo baz
161 test_expect_success
'foo is different in index from HEAD -- rm should refuse' '
162 test_must_fail git rm foo baz &&
163 test_path_is_file foo &&
164 test_path_is_file baz &&
165 git ls-files --error-unmatch foo baz
168 test_expect_success
'but with -f it should work.' '
170 test_path_is_missing foo &&
171 test_path_is_missing baz &&
172 test_must_fail git ls-files --error-unmatch foo &&
173 test_must_fail git ls-files --error-unmatch baz
176 test_expect_success
'refuse to remove cached empty file with modifications' '
179 echo content >empty &&
180 test_must_fail git rm --cached empty
183 test_expect_success
'remove intent-to-add file without --force' '
184 echo content >intent-to-add &&
185 git add -N intent-to-add &&
186 git rm --cached intent-to-add
189 test_expect_success
'Recursive test setup' '
191 echo qfwfq >frotz/nitfol &&
193 git commit -m "subdir test"
196 test_expect_success
'Recursive without -r fails' '
197 test_must_fail git rm frotz &&
198 test_path_is_dir frotz &&
199 test_path_is_file frotz/nitfol
202 test_expect_success
'Recursive with -r but dirty' '
203 echo qfwfq >>frotz/nitfol &&
204 test_must_fail git rm -r frotz &&
205 test_path_is_dir frotz &&
206 test_path_is_file frotz/nitfol
209 test_expect_success
'Recursive with -r -f' '
210 git rm -f -r frotz &&
211 test_path_is_missing frotz/nitfol &&
212 test_path_is_missing frotz
215 test_expect_success
'Remove nonexistent file returns nonzero exit status' '
216 test_must_fail git rm nonexistent
219 test_expect_success
'Call "rm" from outside the work tree' '
224 echo something >somefile &&
226 git commit -m "add a file" &&
229 git --git-dir=repo/.git --work-tree=repo rm somefile
231 test_must_fail git ls-files --error-unmatch somefile
235 test_expect_success
'refresh index before checking if it is up-to-date' '
237 test-tool chmtime -86400 frotz/nitfol &&
238 git rm frotz/nitfol &&
239 test_path_is_missing frotz/nitfol
242 test_expect_success
'choking "git rm" should not let it die with cruft' '
243 git reset -q --hard &&
244 test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
246 while test $i -lt 12000
248 echo "100644 1234567890123456789012345678901234567890 0 some-file-$i"
250 done | git update-index --index-info &&
251 git rm -n "some-file-*" | : &&
252 test_path_is_missing .git/index.lock
255 test_expect_success
'Resolving by removal is not a warning-worthy event' '
256 git reset -q --hard &&
257 test_when_finished "rm -f .git/index.lock msg && git reset -q --hard" &&
258 blob=$(echo blob | git hash-object -w --stdin) &&
261 echo "100644 $blob $stage blob"
262 done | git update-index --index-info &&
263 git rm blob >msg 2>&1 &&
264 test_i18ngrep ! "needs merge" msg &&
265 test_must_fail git ls-files -s --error-unmatch blob
268 test_expect_success
'rm removes subdirectories recursively' '
269 mkdir -p dir/subdir/subsubdir &&
270 echo content >dir/subdir/subsubdir/file &&
271 git add dir/subdir/subsubdir/file &&
272 git rm -f dir/subdir/subsubdir/file &&
273 test_path_is_missing dir
281 cat >expect.modified
<<EOF
285 cat >expect.modified_inside
<<EOF
289 cat >expect.modified_untracked
<<EOF
293 cat >expect.cached
<<EOF
297 cat >expect.both_deleted
<<EOF
302 test_expect_success
'rm removes empty submodules from work tree' '
304 git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod &&
305 git config -f .gitmodules submodule.sub.url ./. &&
306 git config -f .gitmodules submodule.sub.path submod &&
307 git submodule init &&
308 git add .gitmodules &&
309 git commit -m "add submodule" &&
311 test_path_is_missing submod &&
312 git status -s -uno --ignore-submodules=none >actual &&
313 test_cmp expect actual &&
314 test_must_fail git config -f .gitmodules submodule.sub.url &&
315 test_must_fail git config -f .gitmodules submodule.sub.path
318 test_expect_success
'rm removes removed submodule from index and .gitmodules' '
320 git submodule update &&
323 git status -s -uno --ignore-submodules=none >actual &&
324 test_cmp expect actual &&
325 test_must_fail git config -f .gitmodules submodule.sub.url &&
326 test_must_fail git config -f .gitmodules submodule.sub.path
329 test_expect_success
'rm removes work tree of unmodified submodules' '
331 git submodule update &&
333 test_path_is_missing submod &&
334 git status -s -uno --ignore-submodules=none >actual &&
335 test_cmp expect actual &&
336 test_must_fail git config -f .gitmodules submodule.sub.url &&
337 test_must_fail git config -f .gitmodules submodule.sub.path
340 test_expect_success
'rm removes a submodule with a trailing /' '
342 git submodule update &&
344 test_path_is_missing submod &&
345 git status -s -uno --ignore-submodules=none >actual &&
346 test_cmp expect actual
349 test_expect_success
'rm fails when given a file with a trailing /' '
350 test_must_fail git rm empty/
353 test_expect_success
'rm succeeds when given a directory with a trailing /' '
357 test_expect_success
'rm of a populated submodule with different HEAD fails unless forced' '
359 git submodule update &&
360 git -C submod checkout HEAD^ &&
361 test_must_fail git rm submod &&
362 test_path_is_dir submod &&
363 test_path_is_file submod/.git &&
364 git status -s -uno --ignore-submodules=none >actual &&
365 test_cmp expect.modified actual &&
367 test_path_is_missing submod &&
368 git status -s -uno --ignore-submodules=none >actual &&
369 test_cmp expect actual &&
370 test_must_fail git config -f .gitmodules submodule.sub.url &&
371 test_must_fail git config -f .gitmodules submodule.sub.path
374 test_expect_success
'rm --cached leaves work tree of populated submodules and .gitmodules alone' '
376 git submodule update &&
377 git rm --cached submod &&
378 test_path_is_dir submod &&
379 test_path_is_file submod/.git &&
380 git status -s -uno >actual &&
381 test_cmp expect.cached actual &&
382 git config -f .gitmodules submodule.sub.url &&
383 git config -f .gitmodules submodule.sub.path
386 test_expect_success
'rm --dry-run does not touch the submodule or .gitmodules' '
388 git submodule update &&
390 test_path_is_file submod/.git &&
391 git diff-index --exit-code HEAD
394 test_expect_success
'rm does not complain when no .gitmodules file is found' '
396 git submodule update &&
397 git rm .gitmodules &&
398 git rm submod >actual 2>actual.err &&
399 test_must_be_empty actual.err &&
400 test_path_is_missing submod &&
401 test_path_is_missing submod/.git &&
402 git status -s -uno >actual &&
403 test_cmp expect.both_deleted actual
406 test_expect_success
'rm will error out on a modified .gitmodules file unless staged' '
408 git submodule update &&
409 git config -f .gitmodules foo.bar true &&
410 test_must_fail git rm submod >actual 2>actual.err &&
411 test_file_not_empty actual.err &&
412 test_path_is_dir submod &&
413 test_path_is_file submod/.git &&
414 git diff-files --quiet -- submod &&
415 git add .gitmodules &&
416 git rm submod >actual 2>actual.err &&
417 test_must_be_empty actual.err &&
418 test_path_is_missing submod &&
419 test_path_is_missing submod/.git &&
420 git status -s -uno >actual &&
421 test_cmp expect actual
424 test_expect_success
'rm issues a warning when section is not found in .gitmodules' '
426 git submodule update &&
427 git config -f .gitmodules --remove-section submodule.sub &&
428 git add .gitmodules &&
429 echo "warning: Could not find section in .gitmodules where path=submod" >expect.err &&
430 git rm submod >actual 2>actual.err &&
431 test_i18ncmp expect.err actual.err &&
432 test_path_is_missing submod &&
433 test_path_is_missing submod/.git &&
434 git status -s -uno >actual &&
435 test_cmp expect actual
438 test_expect_success
'rm of a populated submodule with modifications fails unless forced' '
440 git submodule update &&
441 echo X >submod/empty &&
442 test_must_fail git rm submod &&
443 test_path_is_dir submod &&
444 test_path_is_file submod/.git &&
445 git status -s -uno --ignore-submodules=none >actual &&
446 test_cmp expect.modified_inside actual &&
448 test_path_is_missing submod &&
449 git status -s -uno --ignore-submodules=none >actual &&
450 test_cmp expect actual
453 test_expect_success
'rm of a populated submodule with untracked files fails unless forced' '
455 git submodule update &&
456 echo X >submod/untracked &&
457 test_must_fail git rm submod &&
458 test_path_is_dir submod &&
459 test_path_is_file submod/.git &&
460 git status -s -uno --ignore-submodules=none >actual &&
461 test_cmp expect.modified_untracked actual &&
463 test_path_is_missing submod &&
464 git status -s -uno --ignore-submodules=none >actual &&
465 test_cmp expect actual
468 test_expect_success
'setup submodule conflict' '
470 git submodule update &&
471 git checkout -b branch1 &&
474 git commit -m "added nitfol 1" &&
475 git checkout -b branch2 master &&
478 git commit -m "added nitfol 2" &&
479 git checkout -b conflict1 master &&
480 git -C submod fetch &&
481 git -C submod checkout branch1 &&
483 git commit -m "submod 1" &&
484 git checkout -b conflict2 master &&
485 git -C submod checkout branch2 &&
487 git commit -m "submod 2"
490 cat >expect.conflict
<<EOF
494 test_expect_success
'rm removes work tree of unmodified conflicted submodule' '
495 git checkout conflict1 &&
497 git submodule update &&
498 test_must_fail git merge conflict2 &&
500 test_path_is_missing submod &&
501 git status -s -uno --ignore-submodules=none >actual &&
502 test_cmp expect actual
505 test_expect_success
'rm of a conflicted populated submodule with different HEAD fails unless forced' '
506 git checkout conflict1 &&
508 git submodule update &&
509 git -C submod checkout HEAD^ &&
510 test_must_fail git merge conflict2 &&
511 test_must_fail git rm submod &&
512 test_path_is_dir submod &&
513 test_path_is_file submod/.git &&
514 git status -s -uno --ignore-submodules=none >actual &&
515 test_cmp expect.conflict actual &&
517 test_path_is_missing submod &&
518 git status -s -uno --ignore-submodules=none >actual &&
519 test_cmp expect actual &&
520 test_must_fail git config -f .gitmodules submodule.sub.url &&
521 test_must_fail git config -f .gitmodules submodule.sub.path
524 test_expect_success
'rm of a conflicted populated submodule with modifications fails unless forced' '
525 git checkout conflict1 &&
527 git submodule update &&
528 echo X >submod/empty &&
529 test_must_fail git merge conflict2 &&
530 test_must_fail git rm submod &&
531 test_path_is_dir submod &&
532 test_path_is_file submod/.git &&
533 git status -s -uno --ignore-submodules=none >actual &&
534 test_cmp expect.conflict actual &&
536 test_path_is_missing submod &&
537 git status -s -uno --ignore-submodules=none >actual &&
538 test_cmp expect actual &&
539 test_must_fail git config -f .gitmodules submodule.sub.url &&
540 test_must_fail git config -f .gitmodules submodule.sub.path
543 test_expect_success
'rm of a conflicted populated submodule with untracked files fails unless forced' '
544 git checkout conflict1 &&
546 git submodule update &&
547 echo X >submod/untracked &&
548 test_must_fail git merge conflict2 &&
549 test_must_fail git rm submod &&
550 test_path_is_dir submod &&
551 test_path_is_file submod/.git &&
552 git status -s -uno --ignore-submodules=none >actual &&
553 test_cmp expect.conflict actual &&
555 test_path_is_missing submod &&
556 git status -s -uno --ignore-submodules=none >actual &&
557 test_cmp expect actual
560 test_expect_success
'rm of a conflicted populated submodule with a .git directory fails even when forced' '
561 git checkout conflict1 &&
563 git submodule update &&
567 cp -R ../.git/modules/sub .git &&
568 GIT_WORK_TREE=. git config --unset core.worktree
570 test_must_fail git merge conflict2 &&
571 test_must_fail git rm submod &&
572 test_path_is_dir submod &&
573 test_path_is_dir submod/.git &&
574 git status -s -uno --ignore-submodules=none >actual &&
575 test_cmp expect.conflict actual &&
576 test_must_fail git rm -f submod &&
577 test_path_is_dir submod &&
578 test_path_is_dir submod/.git &&
579 git status -s -uno --ignore-submodules=none >actual &&
580 test_cmp expect.conflict actual &&
585 test_expect_success
'rm of a conflicted unpopulated submodule succeeds' '
586 git checkout conflict1 &&
588 test_must_fail git merge conflict2 &&
590 test_path_is_missing submod &&
591 git status -s -uno --ignore-submodules=none >actual &&
592 test_cmp expect actual
595 test_expect_success
'rm of a populated submodule with a .git directory migrates git dir' '
596 git checkout -f master &&
598 git submodule update &&
602 cp -R ../.git/modules/sub .git &&
603 GIT_WORK_TREE=. git config --unset core.worktree &&
604 rm -r ../.git/modules/sub
606 git rm submod 2>output.err &&
607 test_path_is_missing submod &&
608 test_path_is_missing submod/.git &&
609 git status -s -uno --ignore-submodules=none >actual &&
610 test_file_not_empty actual &&
611 test_i18ngrep Migrating output.err
614 cat >expect.deepmodified
<<EOF
618 test_expect_success
'setup subsubmodule' '
620 git submodule update &&
623 git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod &&
624 git config -f .gitmodules submodule.sub.url ../. &&
625 git config -f .gitmodules submodule.sub.path subsubmod &&
626 git submodule init &&
627 git add .gitmodules &&
628 git commit -m "add subsubmodule" &&
629 git submodule update subsubmod
631 git commit -a -m "added deep submodule"
634 test_expect_success
'rm recursively removes work tree of unmodified submodules' '
636 test_path_is_missing submod &&
637 git status -s -uno --ignore-submodules=none >actual &&
638 test_cmp expect actual
641 test_expect_success
'rm of a populated nested submodule with different nested HEAD fails unless forced' '
643 git submodule update --recursive &&
644 git -C submod/subsubmod checkout HEAD^ &&
645 test_must_fail git rm submod &&
646 test_path_is_dir submod &&
647 test_path_is_file submod/.git &&
648 git status -s -uno --ignore-submodules=none >actual &&
649 test_cmp expect.modified_inside actual &&
651 test_path_is_missing submod &&
652 git status -s -uno --ignore-submodules=none >actual &&
653 test_cmp expect actual
656 test_expect_success
'rm of a populated nested submodule with nested modifications fails unless forced' '
658 git submodule update --recursive &&
659 echo X >submod/subsubmod/empty &&
660 test_must_fail git rm submod &&
661 test_path_is_dir submod &&
662 test_path_is_file submod/.git &&
663 git status -s -uno --ignore-submodules=none >actual &&
664 test_cmp expect.modified_inside actual &&
666 test_path_is_missing submod &&
667 git status -s -uno --ignore-submodules=none >actual &&
668 test_cmp expect actual
671 test_expect_success
'rm of a populated nested submodule with nested untracked files fails unless forced' '
673 git submodule update --recursive &&
674 echo X >submod/subsubmod/untracked &&
675 test_must_fail git rm submod &&
676 test_path_is_dir submod &&
677 test_path_is_file submod/.git &&
678 git status -s -uno --ignore-submodules=none >actual &&
679 test_cmp expect.modified_untracked actual &&
681 test_path_is_missing submod &&
682 git status -s -uno --ignore-submodules=none >actual &&
683 test_cmp expect actual
686 test_expect_success
"rm absorbs submodule's nested .git directory" '
688 git submodule update --recursive &&
690 cd submod/subsubmod &&
692 mv ../../.git/modules/sub/modules/sub .git &&
693 GIT_WORK_TREE=. git config --unset core.worktree
695 git rm submod 2>output.err &&
696 test_path_is_missing submod &&
697 test_path_is_missing submod/subsubmod/.git &&
698 git status -s -uno --ignore-submodules=none >actual &&
699 test_file_not_empty actual &&
700 test_i18ngrep Migrating output.err
703 test_expect_success
'checking out a commit after submodule removal needs manual updates' '
704 git commit -m "submodule removal" submod .gitmodules &&
705 git checkout HEAD^ &&
706 git submodule update &&
707 git checkout -q HEAD^ &&
708 git checkout -q master 2>actual &&
709 test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
710 git status -s submod >actual &&
711 echo "?? submod/" >expected &&
712 test_cmp expected actual &&
714 git status -s -uno --ignore-submodules=none >actual &&
715 test_must_be_empty actual
718 test_expect_success
'rm of d/f when d has become a non-directory' '
726 test_must_fail git rev-parse --verify :d/f &&
730 test_expect_success SYMLINKS
'rm of d/f when d has become a dangling symlink' '
736 ln -s nonexistent d &&
738 test_must_fail git rev-parse --verify :d/f &&
740 test_path_is_missing d
743 test_expect_success
'rm of file when it has become a directory' '
750 test_must_fail git rm d &&
751 git rev-parse --verify :d &&
752 test_path_is_file d/f
755 test_expect_success SYMLINKS
'rm across a symlinked leading path (no index)' '
761 git commit -m "symlink d to e, e/f exists" &&
762 test_must_fail git rm d/f &&
763 git rev-parse --verify :d &&
764 git rev-parse --verify :e/f &&
766 test_path_is_file e/f
769 test_expect_failure SYMLINKS
'rm across a symlinked leading path (w/ index)' '
774 git commit -m "d/f exists" &&
777 test_must_fail git rm d/f &&
778 git rev-parse --verify :d/f &&
780 test_path_is_file e/f
783 test_expect_success
'setup for testing rm messages' '
786 git add bar.txt foo.txt
789 test_expect_success
'rm files with different staged content' '
790 cat >expect <<-\EOF &&
791 error: the following files have staged content different from both the
795 (use -f to force removal)
797 echo content1 >foo.txt &&
798 echo content1 >bar.txt &&
799 test_must_fail git rm foo.txt bar.txt 2>actual &&
800 test_i18ncmp expect actual
803 test_expect_success
'rm files with different staged content without hints' '
804 cat >expect <<-\EOF &&
805 error: the following files have staged content different from both the
810 echo content2 >foo.txt &&
811 echo content2 >bar.txt &&
812 test_must_fail git -c advice.rmhints=false rm foo.txt bar.txt 2>actual &&
813 test_i18ncmp expect actual
816 test_expect_success
'rm file with local modification' '
817 cat >expect <<-\EOF &&
818 error: the following file has local modifications:
820 (use --cached to keep the file, or -f to force removal)
822 git commit -m "testing rm 3" &&
823 echo content3 >foo.txt &&
824 test_must_fail git rm foo.txt 2>actual &&
825 test_i18ncmp expect actual
828 test_expect_success
'rm file with local modification without hints' '
829 cat >expect <<-\EOF &&
830 error: the following file has local modifications:
833 echo content4 >bar.txt &&
834 test_must_fail git -c advice.rmhints=false rm bar.txt 2>actual &&
835 test_i18ncmp expect actual
838 test_expect_success
'rm file with changes in the index' '
839 cat >expect <<-\EOF &&
840 error: the following file has changes staged in the index:
842 (use --cached to keep the file, or -f to force removal)
845 echo content5 >foo.txt &&
847 test_must_fail git rm foo.txt 2>actual &&
848 test_i18ncmp expect actual
851 test_expect_success
'rm file with changes in the index without hints' '
852 cat >expect <<-\EOF &&
853 error: the following file has changes staged in the index:
856 test_must_fail git -c advice.rmhints=false rm foo.txt 2>actual &&
857 test_i18ncmp expect actual
860 test_expect_success
'rm files with two different errors' '
861 cat >expect <<-\EOF &&
862 error: the following file has staged content different from both the
865 (use -f to force removal)
866 error: the following file has changes staged in the index:
868 (use --cached to keep the file, or -f to force removal)
870 echo content >foo1.txt &&
872 echo content6 >foo1.txt &&
873 echo content6 >bar1.txt &&
875 test_must_fail git rm bar1.txt foo1.txt 2>actual &&
876 test_i18ncmp expect actual
879 test_expect_success
'rm empty string should fail' '
880 test_must_fail git rm -rf ""