From: Junio C Hamano Date: Mon, 15 Nov 2010 19:02:15 +0000 (-0800) Subject: Merge branch 'en/and-cascade-tests' into next X-Git-Tag: ko-next~149 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d51ec77fafdb0a85ff8be52dc8f823a29738f3c7;p=git.git Merge branch 'en/and-cascade-tests' into next * en/and-cascade-tests: (25 commits) t4124 (apply --whitespace): use test_might_fail t3404: do not use 'describe' to implement test_cmp_rev t3404 (rebase -i): introduce helper to check position of HEAD t3404 (rebase -i): move comment to description t3404 (rebase -i): unroll test_commit loops t3301 (notes): use test_expect_code for clarity t1400 (update-ref): use test_must_fail t1502 (rev-parse --parseopt): test exit code from "-h" t6022 (renaming merge): chain test commands with && test-lib: introduce test_line_count to measure files tests: add missing &&, batch 2 tests: add missing && Introduce sane_unset and use it to ensure proper && chaining t7800 (difftool): add missing && t7601 (merge-pull-config): add missing && t7001 (mv): add missing && t6016 (rev-list-graph-simplify-history): add missing && t5602 (clone-remote-exec): add missing && t4026 (color): remove unneeded and unchained command t4019 (diff-wserror): add lots of missing && ... Conflicts: t/t6020-merge-df.sh t/t6036-recursive-corner-cases.sh t/t7006-pager.sh --- d51ec77fafdb0a85ff8be52dc8f823a29738f3c7 diff --cc t/t0003-attributes.sh index e75153bde,7590b453d..ebbc7554a --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@@ -60,19 -57,9 +60,19 @@@ test_expect_success 'attribute test' ' +test_expect_success 'core.attributesfile' ' + attr_check global unspecified && + git config core.attributesfile "$HOME/global-gitattributes" && + attr_check global global && + git config core.attributesfile "~/global-gitattributes" && + attr_check global global && + echo "global test=precedence" >> .gitattributes && + attr_check global precedence +' + test_expect_success 'attribute test: read paths from stdin' ' - cat < expect + cat < expect && f: test: f a/f: test: f a/c/f: test: f diff --cc t/t556x_common index 51287d89d,03dcfb10c..82926cfdb --- a/t/t556x_common +++ b/t/t556x_common @@@ -50,9 -50,9 +50,9 @@@ get_static_files() } SMART=smart -export GIT_HTTP_EXPORT_ALL=1 +GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL test_expect_success 'direct refs/heads/master not found' ' - log_div "refs/heads/master" + log_div "refs/heads/master" && GET refs/heads/master "404 Not Found" ' test_expect_success 'static file is ok' ' @@@ -73,9 -73,9 +73,9 @@@ test_expect_success 'export if git-daem get_static_files "200 OK" ' SMART=smart -export GIT_HTTP_EXPORT_ALL=1 +GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL test_expect_success 'static file if http.getanyfile true is ok' ' - log_div "getanyfile true" + log_div "getanyfile true" && config http.getanyfile true && get_static_files "200 OK" ' diff --cc t/t6020-merge-df.sh index b129f1dbd,5d91d056d..eec8f4e3e --- a/t/t6020-merge-df.sh +++ b/t/t6020-merge-df.sh @@@ -6,25 -6,22 +6,25 @@@ test_description='Test merge with directory/file conflicts' . ./test-lib.sh -test_expect_success 'prepare repository' \ -'echo "Hello" > init && -git add init && -git commit -m "Initial commit" && -git branch B && -mkdir dir && -echo "foo" > dir/foo && -git add dir/foo && -git commit -m "File: dir/foo" && -git checkout B && -echo "file dir" > dir && -git add dir && -git commit -m "File: dir"' +test_expect_success 'prepare repository' ' + echo Hello >init && + git add init && + git commit -m initial && + + git branch B && + mkdir dir && + echo foo >dir/foo && + git add dir/foo && + git commit -m "File: dir/foo" && + + git checkout B && + echo file dir >dir && + git add dir && + git commit -m "File: dir" +' test_expect_success 'Merge with d/f conflicts' ' - test_must_fail git merge master + test_expect_code 1 git merge "merge msg" B master ' test_expect_success 'F/D conflict' ' diff --cc t/t6036-recursive-corner-cases.sh index a2e5c5c08,004c365ad..871577d90 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@@ -14,8 -14,8 +14,8 @@@ test_description='recursive merge corne # R1 R2 # -test_expect_success setup ' +test_expect_success 'setup basic criss-cross + rename with no modifications' ' - ten="0 1 2 3 4 5 6 7 8 9" + ten="0 1 2 3 4 5 6 7 8 9" && for i in $ten do echo line $i in a sample file diff --cc t/t7006-pager.sh index 5641b5955,7d00d49d0..e9d8b9110 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@@ -11,8 -10,38 +11,8 @@@ cleanup_fail() (exit 1) } -test_expect_success 'set up terminal for tests' ' - rm -f stdout_is_tty || - cleanup_fail && - - if test -t 1 - then - >stdout_is_tty - elif - test_have_prereq PERL && - "$PERL_PATH" "$TEST_DIRECTORY"/t7006/test-terminal.perl \ - sh -c "test -t 1" - then - >test_terminal_works - fi -' - -if test -e stdout_is_tty -then - test_terminal() { "$@"; } - test_set_prereq TTY -elif test -e test_terminal_works -then - test_terminal() { - "$PERL_PATH" "$TEST_DIRECTORY"/t7006/test-terminal.perl "$@" - } - test_set_prereq TTY -else - say "# no usable terminal, so skipping some tests" -fi - test_expect_success 'setup' ' - unset GIT_PAGER GIT_PAGER_IN_USE; + sane_unset GIT_PAGER GIT_PAGER_IN_USE && test_might_fail git config --unset core.pager && PAGER="cat >paginated.out" && @@@ -219,8 -253,8 +219,8 @@@ parse_args() test_default_pager() { parse_args "$@" - $test_expectation SIMPLEPAGERTTY "$cmd - default pager is used by default" " + $test_expectation SIMPLEPAGER,TTY "$cmd - default pager is used by default" " - unset PAGER GIT_PAGER; + sane_unset PAGER GIT_PAGER && test_might_fail git config --unset core.pager && rm -f default_pager_used || cleanup_fail &&