Skip to content

Commit f5cfd52

Browse files
committed
Merge branch 'maint-1.7.5' into maint
* maint-1.7.5: test: skip clean-up when running under --immediate mode "branch -d" can remove more than one branches
2 parents f696543 + b586744 commit f5cfd52

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
static const char * const builtin_branch_usage[] = {
2020
"git branch [options] [-r | -a] [--merged | --no-merged]",
2121
"git branch [options] [-l] [-f] <branchname> [<start-point>]",
22-
"git branch [options] [-r] (-d | -D) <branchname>",
22+
"git branch [options] [-r] (-d | -D) <branchname>...",
2323
"git branch [options] (-m | -M) [<oldbranch>] <newbranch>",
2424
NULL
2525
};

t/test-lib.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,14 @@ test_debug () {
446446

447447
test_run_ () {
448448
test_cleanup=:
449+
expecting_failure=$2
449450
eval >&3 2>&4 "$1"
450451
eval_ret=$?
451-
eval >&3 2>&4 "$test_cleanup"
452+
453+
if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure"
454+
then
455+
eval >&3 2>&4 "$test_cleanup"
456+
fi
452457
if test "$verbose" = "t" && test -n "$HARNESS_ACTIVE"; then
453458
echo ""
454459
fi
@@ -497,7 +502,7 @@ test_expect_failure () {
497502
if ! test_skip "$@"
498503
then
499504
say >&3 "checking known breakage: $2"
500-
test_run_ "$2"
505+
test_run_ "$2" expecting_failure
501506
if [ "$?" = 0 -a "$eval_ret" = 0 ]
502507
then
503508
test_known_broken_ok_ "$1"
@@ -774,6 +779,9 @@ test_cmp() {
774779
#
775780
# except that the greeting and config --unset must both succeed for
776781
# the test to pass.
782+
#
783+
# Note that under --immediate mode, no clean-up is done to help diagnose
784+
# what went wrong.
777785

778786
test_when_finished () {
779787
test_cleanup="{ $*

0 commit comments

Comments
 (0)