Merge branch 'maint-1.7.5' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Jun 2011 23:41:55 +0000 (16:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Jun 2011 23:41:55 +0000 (16:41 -0700)
* maint-1.7.5:
test: skip clean-up when running under --immediate mode
"branch -d" can remove more than one branches

1  2 
builtin/branch.c
t/test-lib.sh
diff --combined builtin/branch.c
index d6ab93bfbb369965e76e384e6984a29b667cdfbe,63f4e69925d4c6e7db88db26ce080f09e348c8e8..3142daa57a6fa1c8a7d21095946bf5d26443d0e0
@@@ -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] <branchname> [<start-point>]",
-       "git branch [options] [-r] (-d | -D) <branchname>",
+       "git branch [options] [-r] (-d | -D) <branchname>...",
        "git branch [options] (-m | -M) [<oldbranch>] <newbranch>",
        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 8c57a0059574ff78626ad0e26d3f75da9204b23d,875d05ed50d0dfd94efd3e23ecb4982fd7ca6b98..df25f1792923a65aab2c4ce88e7b528effb381f5
@@@ -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"