From: Junio C Hamano Date: Wed, 29 Jun 2011 23:41:55 +0000 (-0700) Subject: Merge branch 'maint-1.7.5' into maint X-Git-Tag: v1.7.6.1~59 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f5cfd52f7b85d693b3782297819981a502a0135b?ds=inline;hp=-c 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 --- f5cfd52f7b85d693b3782297819981a502a0135b diff --combined builtin/branch.c index d6ab93bfbb,63f4e69925..3142daa57a --- a/builtin/branch.c +++ b/builtin/branch.c @@@ -19,7 -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 }; @@@ -399,7 -399,9 +399,7 @@@ static void add_verbose_info(struct str struct commit *commit = item->commit; if (commit && !parse_commit(commit)) { - struct pretty_print_context ctx = {0}; - pretty_print_commit(CMIT_FMT_ONELINE, commit, - &subject, &ctx); + pp_commit_easy(CMIT_FMT_ONELINE, commit, &subject); sub = subject.buf; } diff --combined t/test-lib.sh index 8c57a00595,875d05ed50..df25f17929 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -446,9 -446,14 +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 +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" @@@ -578,7 -583,7 +583,7 @@@ test_external () test_external_without_stderr () { # The temporary file has no (and must have no) security # implications. - tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi + tmp=${TMPDIR:-/tmp} stderr="$tmp/git-external-stderr.$$.tmp" test_external "$@" 4> "$stderr" [ -f "$stderr" ] || error "Internal error: $stderr disappeared." @@@ -731,11 -736,12 +736,11 @@@ test_expect_code () exit_code=$? if test $exit_code = $want_code then - echo >&2 "test_expect_code: command exited with $exit_code: $*" return 0 - else - echo >&2 "test_expect_code: command exited with $exit_code, we wanted $want_code $*" - return 1 fi + + echo >&2 "test_expect_code: command exited with $exit_code, we wanted $want_code $*" + return 1 } # test_cmp is a helper function to compare actual and expected output. @@@ -774,6 -780,9 +779,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="{ $* @@@ -803,14 -812,12 +811,14 @@@ test_done () mkdir -p "$test_results_dir" test_results_path="$test_results_dir/${0%.sh}-$$.counts" - echo "total $test_count" >> $test_results_path - echo "success $test_success" >> $test_results_path - echo "fixed $test_fixed" >> $test_results_path - echo "broken $test_broken" >> $test_results_path - echo "failed $test_failure" >> $test_results_path - echo "" >> $test_results_path + cat >>"$test_results_path" <<-EOF + total $test_count + success $test_success + fixed $test_fixed + broken $test_broken + failed $test_failure + + EOF fi if test "$test_fixed" != 0 @@@ -884,13 -891,8 +892,13 @@@ the } make_valgrind_symlink () { - # handle only executables - test -x "$1" || return + # handle only executables, unless they are shell libraries that + # need to be in the exec-path. We will just use "#!" as a + # guess for a shell-script, since we have no idea what the user + # may have configured as the shell path. + test -x "$1" || + test "#!" = "$(head -c 2 <"$1")" || + return; base=$(basename "$1") symlink_target=$GIT_BUILD_DIR/$base @@@ -1076,7 -1078,6 +1084,7 @@@ esa test -z "$NO_PERL" && test_set_prereq PERL test -z "$NO_PYTHON" && test_set_prereq PYTHON +test -n "$USE_LIBPCRE" && test_set_prereq LIBPCRE # Can we rely on git's output in the C locale? if test -n "$GETTEXT_POISON"