From: Junio C Hamano Date: Wed, 18 Feb 2009 19:31:52 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.6.2-rc2~22 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/25487f8e2ae266936df0f807ae79dca41606e404?ds=inline;hp=-c Merge branch 'maint' * maint: tests: fix "export var=val" Skip timestamp differences for diff --no-index Documentation/git-push: --all, --mirror, --tags can not be combined --- 25487f8e2ae266936df0f807ae79dca41606e404 diff --combined diff-no-index.c index 0dbd9dad8b,2d541d9aba..0a14268ba9 --- a/diff-no-index.c +++ b/diff-no-index.c @@@ -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 6f6244ab7e,fc0e1932e6..0c455929e4 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -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 " [ []]" +# +# This will commit a file with the given contents and the given commit +# message. It will also add a tag with as name. +# +# Both and default to . + +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 " ", where +# 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 }