diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-03-24 22:42:50 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-24 22:42:50 +0100 |
commit | 78360b576acb0ee47c90552cb3f976a3c6ba4d6a (patch) | |
tree | e0128da2b0290c7eba533afc506e312b0676de1c /t/t3600-rm.sh | |
parent | refs: use warning() instead of fprintf(stderr, "warning: ") (diff) | |
parent | t0060: fix whitespace in "wc -c" invocation (diff) | |
download | git-78360b576acb0ee47c90552cb3f976a3c6ba4d6a.tar.xz git-78360b576acb0ee47c90552cb3f976a3c6ba4d6a.zip |
Merge branch 'js/windows-tests'
* js/windows-tests:
t0060: fix whitespace in "wc -c" invocation
t5503: GIT_DEBUG_SEND_PACK is not supported on MinGW
t7004: Use prerequisite tags to skip tests that need gpg
Use prerequisites to skip tests that need unzip
t3700: Skip a test with backslashes in pathspec
Skip tests that require a filesystem that obeys POSIX permissions
t0060: Fix tests on Windows
Use prerequisite tags to skip tests that depend on symbolic links
t9100, t9129: Use prerequisite tags for UTF-8 tests
t5302: Use prerequisite tags to skip 64-bit offset tests
Skip tests that fail if the executable bit is not handled by the filesystem
t3600: Use test prerequisite tags
test-lib: Infrastructure to test and check for prerequisites
t0050: Check whether git init detected symbolic link support correctly
Tests on Windows: $(pwd) must return Windows-style paths
test-lib: Work around missing sum on Windows
test-lib: Work around incompatible sort and find on Windows
Conflicts:
t/t3000-ls-files-others.sh
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-x | t/t3600-rm.sh | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 2aefbcf471..76b1bb4545 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -12,31 +12,37 @@ test_expect_success \ 'Initialize test directory' \ "touch -- foo bar baz 'space embedded' -q && git add -- foo bar baz 'space embedded' -q && - git commit -m 'add normal files' && - test_tabs=y && - if touch -- 'tab embedded' 'newline -embedded' - then + git commit -m 'add normal files'" + +if touch -- 'tab embedded' 'newline +embedded' 2>/dev/null +then + test_set_prereq FUNNYNAMES +else + say 'Your filesystem does not allow tabs in filenames.' +fi + +test_expect_success FUNNYNAMES 'add files with funny names' " git add -- 'tab embedded' 'newline embedded' && git commit -m 'add files with tabs and newlines' - else - test_tabs=n - fi" - -test "$test_tabs" = n && say 'Your filesystem does not allow tabs in filenames.' +" +# Determine rm behavior # Later we will try removing an unremovable path to make sure # git rm barfs, but if the test is run as root that cannot be # arranged. -test_expect_success \ - 'Determine rm behavior' \ - ': >test-file - chmod a-w . - rm -f test-file - test -f test-file && test_failed_remove=y - chmod 775 . - rm -f test-file' +: >test-file +chmod a-w . +rm -f test-file 2>/dev/null +if test -f test-file +then + test_set_prereq RO_DIR +else + say 'skipping removal failure test (perhaps running as root?)' +fi +chmod 775 . +rm -f test-file test_expect_success \ 'Pre-check that foo exists and is in index before git rm foo' \ @@ -101,20 +107,16 @@ test_expect_success \ 'Test that "git rm -- -q" succeeds (remove a file that looks like an option)' \ 'git rm -- -q' -test "$test_tabs" = y && test_expect_success \ +test_expect_success FUNNYNAMES \ "Test that \"git rm -f\" succeeds with embedded space, tab, or newline characters." \ "git rm -f 'space embedded' 'tab embedded' 'newline embedded'" -if test "$test_failed_remove" = y; then -chmod a-w . -test_expect_success \ - 'Test that "git rm -f" fails if its rm fails' \ - 'test_must_fail git rm -f baz' -chmod 775 . -else - say 'skipping removal failure test (perhaps running as root?)' -fi +test_expect_success RO_DIR 'Test that "git rm -f" fails if its rm fails' ' + chmod a-w . && + test_must_fail git rm -f baz && + chmod 775 . +' test_expect_success \ 'When the rm in "git rm -f" fails, it should not remove the file from the index' \ |