diff options
author | Steven Grimm <koreth@midwinter.com> | 2007-04-16 00:46:48 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-16 01:06:02 -0700 |
commit | b48caa20de7f62f648de7d3dbb0ceb462879e903 (patch) | |
tree | de936d477179d9518e3464824fa0595435083e32 /t/t3600-rm.sh | |
parent | c7263d4d3d75d177f0ad8a8a730e1e3b401488c7 (diff) | |
download | git-b48caa20de7f62f648de7d3dbb0ceb462879e903.tar.gz git-b48caa20de7f62f648de7d3dbb0ceb462879e903.tar.xz |
Add --quiet option to suppress output of "rm" commands for removed files.
Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-x | t/t3600-rm.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index e31cf93a0..da9da9218 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -84,6 +84,26 @@ test_expect_success \ 'When the rm in "git-rm -f" fails, it should not remove the file from the index' \ 'git-ls-files --error-unmatch baz' +test_expect_success '"rm" command printed' ' + echo frotz > test-file && + git add test-file && + git commit -m "add file for rm test" && + git rm test-file > rm-output && + test `egrep "^rm " rm-output | wc -l` = 1 && + rm -f test-file rm-output && + git commit -m "remove file from rm test" +' + +test_expect_success '"rm" command suppressed with --quiet' ' + echo frotz > test-file && + git add test-file && + git commit -m "add file for rm --quiet test" && + git rm --quiet test-file > rm-output && + test `wc -l < rm-output` = 0 && + rm -f test-file rm-output && + git commit -m "remove file from rm --quiet test" +' + # Now, failure cases. test_expect_success 'Re-add foo and baz' ' git add foo baz && @@ -154,4 +174,8 @@ test_expect_success 'Recursive with -r -f' ' ! test -d frotz ' +test_expect_failure 'Remove nonexistent file returns nonzero exit status' ' + git rm nonexistent +' + test_done |