diff --git a/Documentation/config.txt b/Documentation/config.txt index cc639dc501..c73368ce7c 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1374,10 +1374,6 @@ notes.rewrite.:: automatically copies your notes from the original to the rewritten commit. Defaults to `true`, but see "notes.rewriteRef" below. -+ -This setting can be overridden with the `GIT_NOTES_REWRITE_REF` -environment variable, which must be a colon separated list of refs or -globs. notes.rewriteMode:: When copying notes during a rewrite (see the @@ -1397,6 +1393,10 @@ notes.rewriteRef:: + Does not have a default value; you must configure this variable to enable note rewriting. ++ +This setting can be overridden with the `GIT_NOTES_REWRITE_REF` +environment variable, which must be a colon separated list of refs or +globs. pack.window:: The size of the window used by linkgit:git-pack-objects[1] when no diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index f4ca4fc85c..3ec9cbef2c 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -73,6 +73,27 @@ then exit 1 fi +clean=no +test_expect_success 'tests clean up after themselves' ' + test_when_finished clean=yes +' + +cleaner=no +test_expect_code 1 'tests clean up even after a failure' ' + test_when_finished cleaner=yes && + (exit 1) +' + +if test $clean$cleaner != yesyes +then + say "bug in test framework: cleanup commands do not work reliably" + exit 1 +fi + +test_expect_code 2 'failure to clean up causes the test to fail' ' + test_when_finished "(exit 2)" +' + ################################################################ # Basics of the basics diff --git a/t/test-lib.sh b/t/test-lib.sh index 12fb67f44f..9bfa14be7f 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -366,8 +366,9 @@ test_debug () { } test_run_ () { - test_cleanup='eval_ret=$?' + test_cleanup=: eval >&3 2>&4 "$1" + eval_ret=$? eval >&3 2>&4 "$test_cleanup" return 0 } @@ -583,8 +584,8 @@ test_cmp() { # the test to pass. test_when_finished () { - test_cleanup="eval_ret=\$?; { $* - } && (exit \"\$eval_ret\"); $test_cleanup" + test_cleanup="{ $* + } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup" } # Most tests can use the created repository, but some may need to create more.