From 534cea3fce7d32fc924fd477520fa2e631288ca6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 27 Jun 2011 15:04:32 -0700 Subject: [PATCH 1/2] "branch -d" can remove more than one branches Since 03feddd (git-check-ref-format: reject funny ref names, 2005-10-13), "git branch -d" can take more than one branch names to remove. The documentation was correct, but the usage string was not. Signed-off-by: Junio C Hamano --- builtin/branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/branch.c b/builtin/branch.c index 9cca1b9afc..63f4e69925 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -19,7 +19,7 @@ static const char * const builtin_branch_usage[] = { "git branch [options] [-r | -a] [--merged | --no-merged]", "git branch [options] [-l] [-f] []", - "git branch [options] [-r] (-d | -D) ", + "git branch [options] [-r] (-d | -D) ...", "git branch [options] (-m | -M) [] ", NULL }; From b586744a864cf4d6886d6436d559302123b01fae Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 27 Jun 2011 11:02:22 -0700 Subject: [PATCH 2/2] test: skip clean-up when running under --immediate mode Some tests try to be too careful about cleaning themselves up and do test_expect_success description ' set-up some test refs and/or configuration && test_when_finished "revert the above changes" && the real test ' Which is nice to make sure that a potential failure would not have unexpected interaction with the next test. This however interferes when "the real test" fails and we want to see what is going on, by running the test with --immediate mode and descending into its trash directory after the test stops. The precondition to run the real test and cause it to fail is all gone after the clean-up procedure defined by test_when_finished is done. Update test_run_ which is the workhorse of running a test script called from test_expect_success and test_expect_failure, so that we do not run clean-up script defined with test_when_finished when a test that is expected to succeed fails under the --immediate mode. Signed-off-by: Junio C Hamano Acked-by: Jeff King --- t/test-lib.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index a3fe16d2b0..875d05ed50 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -446,9 +446,14 @@ test_debug () { test_run_ () { test_cleanup=: + expecting_failure=$2 eval >&3 2>&4 "$1" eval_ret=$? - eval >&3 2>&4 "$test_cleanup" + + if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure" + then + eval >&3 2>&4 "$test_cleanup" + fi if test "$verbose" = "t" && test -n "$HARNESS_ACTIVE"; then echo "" fi @@ -497,7 +502,7 @@ test_expect_failure () { if ! test_skip "$@" then say >&3 "checking known breakage: $2" - test_run_ "$2" + test_run_ "$2" expecting_failure if [ "$?" = 0 -a "$eval_ret" = 0 ] then test_known_broken_ok_ "$1" @@ -775,6 +780,9 @@ test_cmp() { # # except that the greeting and config --unset must both succeed for # the test to pass. +# +# Note that under --immediate mode, no clean-up is done to help diagnose +# what went wrong. test_when_finished () { test_cleanup="{ $*