Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Feb 2009 19:31:52 +0000 (11:31 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Feb 2009 19:31:52 +0000 (11:31 -0800)
* maint:
tests: fix "export var=val"
Skip timestamp differences for diff --no-index
Documentation/git-push: --all, --mirror, --tags can not be combined

1  2 
diff-no-index.c
t/test-lib.sh
diff --combined diff-no-index.c
index 0dbd9dad8b100cdd4918571636ad3e9a1a0a2abf,2d541d9aba11ee69525a6a1ef5da6f8a61e9e65e..0a14268ba952da5ff66be753cc0cc147ba64ee2b
@@@ -40,7 -40,7 +40,7 @@@ static int get_mode(const char *path, i
                *mode = 0;
        else if (!strcmp(path, "-"))
                *mode = create_ce_mode(0666);
 -      else if (stat(path, &st))
 +      else if (lstat(path, &st))
                return error("Could not access '%s'", path);
        else
                *mode = st.st_mode;
@@@ -247,6 -247,7 +247,7 @@@ void diff_no_index(struct rev_info *rev
        else
                revs->diffopt.paths = argv + argc - 2;
        revs->diffopt.nr_paths = 2;
+       revs->diffopt.skip_stat_unmatch = 1;
  
        DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
        DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
diff --combined t/test-lib.sh
index 6f6244ab7e1ae8db044224ecb115a1f4cc64f912,fc0e1932e6397403c4efec753e8f4e23fb3cd26a..0c455929e4e52795e616c3e2635f5899dff665c2
@@@ -82,7 -82,7 +82,7 @@@ d
        -i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
                immediate=t; shift ;;
        -l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
-               export GIT_TEST_LONG=t; shift ;;
+               GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;;
        -h|--h|--he|--hel|--help)
                help=t; shift ;;
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
@@@ -127,7 -127,7 +127,7 @@@ f
  
  error () {
        say_color error "error: $*"
 -      trap - exit
 +      trap - EXIT
        exit 1
  }
  
@@@ -163,7 -163,7 +163,7 @@@ die () 
        exit 1
  }
  
 -trap 'die' exit
 +trap 'die' EXIT
  
  # The semantics of the editor variables are that of invoking
  # sh -c "$EDITOR \"$@\"" files ...
@@@ -193,31 -193,6 +193,31 @@@ test_tick () 
        export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
  }
  
 +# Call test_commit with the arguments "<message> [<file> [<contents>]]"
 +#
 +# This will commit a file with the given contents and the given commit
 +# message.  It will also add a tag with <message> as name.
 +#
 +# Both <file> and <contents> default to <message>.
 +
 +test_commit () {
 +      file=${2:-"$1.t"}
 +      echo "${3-$1}" > "$file" &&
 +      git add "$file" &&
 +      test_tick &&
 +      git commit -m "$1" &&
 +      git tag "$1"
 +}
 +
 +# Call test_merge with the arguments "<message> <commit>", where <commit>
 +# can be a tag pointing to the commit-to-merge.
 +
 +test_merge () {
 +      test_tick &&
 +      git merge -m "$1" "$2" &&
 +      git tag "$1"
 +}
 +
  # You are not expected to call test_ok_ and test_failure_ directly, use
  # the text_expect_* functions instead.
  
@@@ -233,7 -208,7 +233,7 @@@ test_failure_ () 
        say_color error "FAIL $test_count: $1"
        shift
        echo "$@" | sed -e 's/^/        /'
 -      test "$immediate" = "" || { trap - exit; exit 1; }
 +      test "$immediate" = "" || { trap - EXIT; exit 1; }
  }
  
  test_known_broken_ok_ () {
@@@ -441,7 -416,7 +441,7 @@@ test_create_repo () 
  }
  
  test_done () {
 -      trap - exit
 +      trap - EXIT
        test_results_dir="$TEST_DIRECTORY/test-results"
        mkdir -p "$test_results_dir"
        test_results_path="$test_results_dir/${0%-*}-$$"
@@@ -518,7 -493,7 +518,7 @@@ f
  test="trash directory.$(basename "$0" .sh)"
  test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
  rm -fr "$test" || {
 -      trap - exit
 +      trap - EXIT
        echo >&5 "FATAL: Cannot prepare test area"
        exit 1
  }