From 9d3f42af0101f352fafeeb0a121d4e9840805f44 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 11 Apr 2014 12:40:22 -0500 Subject: [PATCH] fixup! Merge 'win-tests-fixes' into HEAD This reverts commit 616c7ba9be71cf837f123671270e4b7b60fe49d3, reversing changes made to 85efa6f0127dbefc98f4d50b0a80c871a46bb4ad. Stepan Kasal provided a rebased version of this topic branch. Let's revert the old version first. Signed-off-by: Johannes Schindelin --- Makefile | 3 --- git-am.sh | 4 +-- git-merge-octopus.sh | 12 +++------ git-sh-setup.sh | 4 +-- git-submodule.sh | 8 +++--- t/annotate-tests.sh | 24 ++++++++--------- t/lib-credential.sh | 2 +- t/t0008-ignores.sh | 8 +----- t/t0026-eol-config.sh | 18 ------------- t/t0081-line-buffer.sh | 2 +- t/t0110-urlmatch-normalization.sh | 2 +- t/t1050-large.sh | 8 +++--- t/t1306-xdg-files.sh | 4 +-- t/t1501-worktree.sh | 4 --- t/t3102-ls-tree-wildcards.sh | 4 +-- t/t3404-rebase-interactive.sh | 14 +++++----- t/t3901-i18n-patch.sh | 19 ++++++-------- t/t4041-diff-submodule-option.sh | 2 +- t/t4201-shortlog.sh | 6 ++--- t/t4205-log-pretty-formats.sh | 3 +-- t/t4210-log-i18n.sh | 4 +-- t/t5407-post-rewrite-hook.sh | 10 +++----- t/t5504-fetch-receive-strict.sh | 4 +-- t/t6006-rev-list-format.sh | 13 +++++----- t/t6038-merge-text-auto.sh | 54 +++++++++++++++------------------------ t/t7102-reset.sh | 4 +-- t/t7407-submodule-foreach.sh | 16 ------------ t/t7800-difftool.sh | 12 ++++----- t/t8005-blame-i18n.sh | 8 +++--- t/t9001-send-email.sh | 30 +++++++++++----------- t/t9350-fast-export.sh | 11 -------- t/t9902-completion.sh | 17 +++--------- t/test-lib.sh | 19 +------------- 33 files changed, 117 insertions(+), 236 deletions(-) diff --git a/Makefile b/Makefile index e90f57ed28..29a555d4bf 100644 --- a/Makefile +++ b/Makefile @@ -1482,9 +1482,6 @@ ifdef NO_REGEX COMPAT_CFLAGS += -Icompat/regex COMPAT_OBJS += compat/regex/regex.o endif -ifdef NATIVE_CRLF - BASIC_CFLAGS += -DNATIVE_CRLF -endif ifdef USE_NED_ALLOCATOR COMPAT_CFLAGS += -Icompat/nedmalloc diff --git a/git-am.sh b/git-am.sh index ec4ac25f7d..deb2edd206 100755 --- a/git-am.sh +++ b/git-am.sh @@ -182,9 +182,7 @@ It does not apply to blobs recorded in its index.")" } clean_abort () { - test $# = 0 || cat >&2 <&2 "$@" rm -fr "$dotest" exit 1 } diff --git a/git-merge-octopus.sh b/git-merge-octopus.sh index 2226eeba99..8643f74cb0 100755 --- a/git-merge-octopus.sh +++ b/git-merge-octopus.sh @@ -71,9 +71,7 @@ do case "$LF$common$LF" in *"$LF$SHA1$LF"*) - cat << EOF -Already up-to-date with $pretty_name -EOF + echo "Already up-to-date with $pretty_name" continue ;; esac @@ -85,9 +83,7 @@ EOF # tree as the intermediate result of the merge. # We still need to count this as part of the parent set. - cat << EOF -Fast-forwarding to: $pretty_name -EOF + echo "Fast-forwarding to: $pretty_name" git read-tree -u -m $head $SHA1 || exit MRC=$SHA1 MRT=$(git write-tree) continue @@ -95,9 +91,7 @@ EOF NON_FF_MERGE=1 - cat << EOF -Trying simple merge with $pretty_name -EOF + echo "Trying simple merge with $pretty_name" git read-tree -u -m --aggressive $common $MRT $SHA1 || exit 2 next=$(git write-tree 2>/dev/null) if test $? -ne 0 diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 955311b94e..2dae6e67d9 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -59,9 +59,7 @@ GIT_QUIET= say () { if test -z "$GIT_QUIET" then - cat < /dev/null 2>&1 then - cat >&2 <&2 exit 1 fi diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh index 4039723927..304c7b7d87 100644 --- a/t/annotate-tests.sh +++ b/t/annotate-tests.sh @@ -251,27 +251,27 @@ test_expect_success 'blame -L X,-N' ' ' test_expect_success 'blame -L /RE/ (RE to end)' ' - check_count -L/\;*evil/ C 1 "A U Thor" 1 + check_count -L/evil/ C 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/,/RE2/' ' - check_count -L/\;*robot/,/\;*green/ A 1 B 1 B2 1 D 1 E 1 + check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1 ' test_expect_success 'blame -L X,/RE/' ' - check_count -L5,/\;*evil/ B1 1 D 1 "A U Thor" 1 + check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/,Y' ' - check_count -L/\;*99/,7 B1 1 D 1 "A U Thor" 1 + check_count -L/99/,7 B1 1 D 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/,+N' ' - check_count -L/\;*99/,+3 B1 1 D 1 "A U Thor" 1 + check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/,-N' ' - check_count -L/\;*99/,-3 B 1 B2 1 D 1 + check_count -L/99/,-3 B 1 B2 1 D 1 ' # 'file' ends with an incomplete line, so 'wc' reports one fewer lines than @@ -337,19 +337,19 @@ test_expect_success 'blame -L multiple (superset/subset: unordered)' ' ' test_expect_success 'blame -L /RE/ (relative)' ' - check_count -L3,3 -L/\;*fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1 + check_count -L3,3 -L/fox/ B1 1 B2 1 C 1 D 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/ (relative: no preceding range)' ' - check_count -L/\;*dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1 + check_count -L/dog/ A 1 B 1 B1 1 B2 1 C 1 D 1 "A U Thor" 1 ' test_expect_success 'blame -L /RE/ (relative: adjacent)' ' - check_count -L1,1 -L/\;*dog/,+1 A 1 E 1 + check_count -L1,1 -L/dog/,+1 A 1 E 1 ' test_expect_success 'blame -L /RE/ (relative: not found)' ' - test_must_fail $PROG -L4,4 -L/\;*dog/ file + test_must_fail $PROG -L4,4 -L/dog/ file ' test_expect_success 'blame -L /RE/ (relative: end-of-file)' ' @@ -357,11 +357,11 @@ test_expect_success 'blame -L /RE/ (relative: end-of-file)' ' ' test_expect_success 'blame -L ^/RE/ (absolute)' ' - check_count -L3,3 -L^/\;*dog/,+2 A 1 B2 1 + check_count -L3,3 -L^/dog/,+2 A 1 B2 1 ' test_expect_success 'blame -L ^/RE/ (absolute: no preceding range)' ' - check_count -L^/\;*dog/,+2 A 1 B2 1 + check_count -L^/dog/,+2 A 1 B2 1 ' test_expect_success 'blame -L ^/RE/ (absolute: not found)' ' diff --git a/t/lib-credential.sh b/t/lib-credential.sh index 86a31c2c45..347d98ebde 100755 --- a/t/lib-credential.sh +++ b/t/lib-credential.sh @@ -19,7 +19,7 @@ check() { false fi && test_cmp expect-stdout stdout && - test_cmp_text expect-stderr stderr + test_cmp expect-stderr stderr } read_chunk() { diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh index d14a549a8f..b4d98e602f 100755 --- a/t/t0008-ignores.sh +++ b/t/t0008-ignores.sh @@ -5,13 +5,7 @@ test_description=check-ignore . ./test-lib.sh init_vars () { - # On Windows, avoid using "C:" in the global-excludes paths. - if test_have_prereq MINGW - then - global_excludes="global-excludes" - else - global_excludes="$(pwd)/global-excludes" - fi + global_excludes="$(pwd)/global-excludes" } enable_global_excludes () { diff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh index 00ff53f768..fe0164be62 100755 --- a/t/t0026-eol-config.sh +++ b/t/t0026-eol-config.sh @@ -80,22 +80,4 @@ test_expect_success 'autocrlf=true overrides unset eol' ' test -z "$onediff" -a -z "$twodiff" ' -test_expect_success NATIVE_CRLF 'eol native is crlf' ' - - rm -rf native_eol && mkdir native_eol && - ( cd native_eol && - printf "*.txt text\n" > .gitattributes - printf "one\r\ntwo\r\nthree\r\n" > filedos.txt - printf "one\ntwo\nthree\n" > fileunix.txt - git init && - git config core.autocrlf false && - git config core.eol native && - git add filedos.txt fileunix.txt && - git commit -m "first" && - rm file*.txt && - git reset --hard HEAD && - has_cr filedos.txt && has_cr fileunix.txt - ) -' - test_done diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh index 25dba008f3..bd83ed371a 100755 --- a/t/t0081-line-buffer.sh +++ b/t/t0081-line-buffer.sh @@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' ' test_cmp expect actual ' -test_expect_success NOT_MINGW 'read from file descriptor' ' +test_expect_success 'read from file descriptor' ' rm -f input && echo hello >expect && echo hello >input && diff --git a/t/t0110-urlmatch-normalization.sh b/t/t0110-urlmatch-normalization.sh index bcbb825034..8d6096d4d1 100755 --- a/t/t0110-urlmatch-normalization.sh +++ b/t/t0110-urlmatch-normalization.sh @@ -117,7 +117,7 @@ test_expect_success 'url general escapes' ' test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'" ' -test_expect_success !MINGW 'url high-bit escapes' ' +test_expect_success 'url high-bit escapes' ' test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" && test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" && test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" && diff --git a/t/t1050-large.sh b/t/t1050-large.sh index 76ca151578..fd10528009 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -9,10 +9,10 @@ test_expect_success setup ' # clone does not allow us to pass core.bigfilethreshold to # new repos, so set core.bigfilethreshold globally git config --global core.bigfilethreshold 200k && - perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large1 && - perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large2 && - perl -e "print \"\\0\" x 2048000; print \"X\\n\";" > large3 && - perl -e "print \"\\0\" x 2560000; print \"Y\\n\";" > huge && + echo X | dd of=large1 bs=1k seek=2000 && + echo X | dd of=large2 bs=1k seek=2000 && + echo X | dd of=large3 bs=1k seek=2000 && + echo Y | dd of=huge bs=1k seek=2500 && GIT_ALLOC_LIMIT=1500 && export GIT_ALLOC_LIMIT ' diff --git a/t/t1306-xdg-files.sh b/t/t1306-xdg-files.sh index 278fdd51f2..8b14ab187c 100755 --- a/t/t1306-xdg-files.sh +++ b/t/t1306-xdg-files.sh @@ -15,7 +15,7 @@ test_expect_success 'read config: xdg file exists and ~/.gitconfig doesn'\''t' ' echo " myalias = !echo in_config" >>.config/git/config && echo in_config >expected && git myalias >actual && - test_cmp_text expected actual + test_cmp expected actual ' @@ -25,7 +25,7 @@ test_expect_success 'read config: xdg file exists and ~/.gitconfig exists' ' echo " myalias = !echo in_gitconfig" >>.gitconfig && echo in_gitconfig >expected && git myalias >actual && - test_cmp_text expected actual + test_cmp expected actual ' diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh index 06982bddb7..8f36aa9fc4 100755 --- a/t/t1501-worktree.sh +++ b/t/t1501-worktree.sh @@ -339,10 +339,6 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' ' git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file ' -test_have_prereq MINGW && -# make sure to test DOS path on Windows -TRASH_DIRECTORY="$(cd "$TRASH_DIRECTORY" && pwd)" - test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' ' GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \ test-subprocess --setup-work-tree rev-parse --show-toplevel >actual && diff --git a/t/t3102-ls-tree-wildcards.sh b/t/t3102-ls-tree-wildcards.sh index 766af3de9b..c286854485 100755 --- a/t/t3102-ls-tree-wildcards.sh +++ b/t/t3102-ls-tree-wildcards.sh @@ -4,14 +4,14 @@ test_description='ls-tree with(out) globs' . ./test-lib.sh -test_expect_success NOT_MINGW 'setup' ' +test_expect_success 'setup' ' mkdir a aa "a[a]" && touch a/one aa/two "a[a]/three" && git add a/one aa/two "a[a]/three" && git commit -m test ' -test_expect_success NOT_MINGW 'ls-tree a* matches literally' ' +test_expect_success 'ls-tree a[a] matches literally' ' cat >expected <expect ) && sed -e "1,9d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -831,7 +831,7 @@ test_expect_success 'running "git rebase --exec git show HEAD -i"' ' git rebase -i HEAD~2 >expect ) && sed -e "1,9d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -845,7 +845,7 @@ test_expect_success 'running "git rebase -ix git show HEAD"' ' git rebase -i HEAD~2 >expect ) && sed -e "1,9d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -859,7 +859,7 @@ test_expect_success 'rebase -ix with several ' ' git rebase -i HEAD~2 >expect ) && sed -e "1,9d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -874,7 +874,7 @@ test_expect_success 'rebase -ix with several instances of --exec' ' git rebase -i HEAD~2 >expect ) && sed -e "1,11d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -900,7 +900,7 @@ test_expect_success 'rebase -ix with --autosquash' ' git rebase -i HEAD~4 >expect ) && sed -e "1,13d" expect >expected && - test_cmp_text expected actual + test_cmp expected actual ' @@ -919,7 +919,7 @@ test_expect_success 'rebase -i --exec without ' ' test_must_fail git rebase -i --exec 2>tmp && sed -e "1d" tmp >actual && test_must_fail git rebase -h >expected && - test_cmp_text expected actual && + test_cmp expected actual && git checkout master ' diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 55c8a2f576..31a5770b34 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -54,13 +54,10 @@ test_expect_success setup ' git add yours && git commit -s -m "Second on side" && - if test_have_prereq NOT_MINGW - then - # the second one on the side branch is ISO-8859-1 - git config i18n.commitencoding ISO8859-1 && - # use author and committer name in ISO-8859-1 to match it. - . "$TEST_DIRECTORY"/t3901-8859-1.txt - fi && + # the second one on the side branch is ISO-8859-1 + git config i18n.commitencoding ISO8859-1 && + # use author and committer name in ISO-8859-1 to match it. + . "$TEST_DIRECTORY"/t3901-8859-1.txt && test_tick && echo Yet another >theirs && git add theirs && @@ -122,7 +119,7 @@ test_expect_success 'rebase (U/L)' ' check_encoding 2 ' -test_expect_success NOT_MINGW 'rebase (L/L)' ' +test_expect_success 'rebase (L/L)' ' # In this test we want ISO-8859-1 encoded commits as the result git config i18n.commitencoding ISO8859-1 && git config i18n.logoutputencoding ISO8859-1 && @@ -134,7 +131,7 @@ test_expect_success NOT_MINGW 'rebase (L/L)' ' check_encoding 2 8859 ' -test_expect_success NOT_MINGW 'rebase (L/U)' ' +test_expect_success 'rebase (L/U)' ' # This is pathological -- use UTF-8 as intermediate form # to get ISO-8859-1 results. git config i18n.commitencoding ISO8859-1 && @@ -162,7 +159,7 @@ test_expect_success 'cherry-pick(U/U)' ' check_encoding 3 ' -test_expect_success NOT_MINGW 'cherry-pick(L/L)' ' +test_expect_success 'cherry-pick(L/L)' ' # Both the commitencoding and logoutputencoding is set to ISO-8859-1 git config i18n.commitencoding ISO8859-1 && @@ -192,7 +189,7 @@ test_expect_success 'cherry-pick(U/L)' ' check_encoding 3 ' -test_expect_success NOT_MINGW 'cherry-pick(L/U)' ' +test_expect_success 'cherry-pick(L/U)' ' # Again, the commitencoding is set to ISO-8859-1 but # logoutputencoding is set to UTF-8. diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index 306b233e27..1751c83307 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -13,7 +13,7 @@ This test tries to verify the sanity of the --submodule option of git diff. # String "added" in German (translated with Google Translate), encoded in UTF-8, # used in sample commit log messages in add_file() function below. -added=$(printf "hinzugef\303\274gt" | iconv -t utf-8) +added=$(printf "hinzugef\303\274gt") add_file () { ( cd "$1" && diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index a1db6fb4ae..42866992cf 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' ' test_cmp expect log.predictable ' -test_expect_success NOT_MINGW 'shortlog wrapping' ' +test_expect_success 'shortlog wrapping' ' cat >expect <<\EOF && A U Thor (5): Test @@ -114,7 +114,7 @@ EOF test_cmp expect out ' -test_expect_success NOT_MINGW 'shortlog from non-git directory' ' +test_expect_success 'shortlog from non-git directory' ' git log HEAD >log && GIT_DIR=non-existing git shortlog -w out && test_cmp expect out @@ -159,7 +159,7 @@ $DSCHO (2): EOF -test_expect_success NOT_MINGW 'shortlog encoding' ' +test_expect_success 'shortlog encoding' ' git reset --hard "$commit" && git config --unset i18n.commitencoding && echo 2 > a1 && diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index ca532d36d2..2a6278bb33 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -28,8 +28,7 @@ test_expect_success 'set up basic repos' ' git add foo && test_tick && git config i18n.commitEncoding iso8859-1 && - commit_msg iso8859-1 > commit_msg && - git commit --file commit_msg && + git commit -m "$(commit_msg iso8859-1)" && git add bar && test_tick && git commit -m "add bar" && diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh index 9110404e55..52a74729ba 100755 --- a/t/t4210-log-i18n.sh +++ b/t/t4210-log-i18n.sh @@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' ' test_cmp expect actual ' -test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' ' +test_expect_success 'log --grep searches in log output encoding (latin1)' ' cat >expect <<-\EOF && latin1 utf8 @@ -43,7 +43,7 @@ test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin test_cmp expect actual ' -test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' ' +test_expect_success 'log --grep does not find non-reencoded values (utf8)' ' >expect && git log --encoding=utf8 --format=%s --grep=$latin1_e >actual && test_cmp expect actual diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh index 710c18bf90..ea2e0d4b48 100755 --- a/t/t5407-post-rewrite-hook.sh +++ b/t/t5407-post-rewrite-hook.sh @@ -20,13 +20,9 @@ test_expect_success 'setup' ' mkdir .git/hooks cat >.git/hooks/post-rewrite <$TRASH_DIRECTORY/post-rewrite.args"); -print AR \$_,"\n" foreach @ARGV; -open (DAT, ">$TRASH_DIRECTORY/post-rewrite.data"); -while() { - print DAT; -} +#!/bin/sh +echo \$@ > "$TRASH_DIRECTORY"/post-rewrite.args +cat > "$TRASH_DIRECTORY"/post-rewrite.data EOF chmod u+x .git/hooks/post-rewrite diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index bb8bc94bfc..69ee13c8be 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -101,7 +101,7 @@ test_expect_success 'push with receive.fsckobjects' ' git config transfer.fsckobjects false ) && test_must_fail git push --porcelain dst master:refs/heads/test >act && - test_cmp exp act || test ! -s act + test_cmp exp act ' test_expect_success 'push with transfer.fsckobjects' ' @@ -112,7 +112,7 @@ test_expect_success 'push with transfer.fsckobjects' ' git config transfer.fsckobjects true ) && test_must_fail git push --porcelain dst master:refs/heads/test >act && - test_cmp exp act || test ! -s act + test_cmp exp act ' test_done diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index 07cd8e5f0b..98744038ec 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -22,15 +22,13 @@ test_expect_success 'setup' ' : >foo && git add foo && git config i18n.commitEncoding iso8859-1 && - echo "$added_iso88591" > commit-msg && - git commit -F commit-msg && + git commit -m "$added_iso88591" && head1=$(git rev-parse --verify HEAD) && head1_short=$(git rev-parse --verify --short $head1) && tree1=$(git rev-parse --verify HEAD:) && tree1_short=$(git rev-parse --verify --short $tree1) && echo "$changed" > foo && - echo "$changed_iso88591" > commit-msg && - git commit -a -F commit-msg && + git commit -a -m "$changed_iso88591" && head2=$(git rev-parse --verify HEAD) && head2_short=$(git rev-parse --verify --short $head2) && tree2=$(git rev-parse --verify HEAD:) && @@ -208,12 +206,13 @@ test_expect_success '%C(auto) respects --color=auto (stdout not tty)' ' ) ' -printf "Test printing of complex bodies +iconv -f utf-8 -t iso8859-1 > commit-msg < commit-msg +include an iso8859 character: ¡bueno! +EOF test_expect_success 'setup complex body' ' git config i18n.commitencoding iso8859-1 && diff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh index 67c59b7e97..d9c2d386dd 100755 --- a/t/t6038-merge-text-auto.sh +++ b/t/t6038-merge-text-auto.sh @@ -72,10 +72,6 @@ test_expect_success 'Merge after setting text=auto' ' same line EOF - if test_have_prereq NATIVE_CRLF; then - append_cr expected.temp && - mv expected.temp expected - fi && git config merge.renormalize true && git rm -fr . && rm -f .gitattributes && @@ -90,10 +86,6 @@ test_expect_success 'Merge addition of text=auto' ' same line EOF - if test_have_prereq NATIVE_CRLF; then - append_cr expected.temp && - mv expected.temp expected - fi && git config merge.renormalize true && git rm -fr . && rm -f .gitattributes && @@ -103,19 +95,16 @@ test_expect_success 'Merge addition of text=auto' ' ' test_expect_success 'Detect CRLF/LF conflict after setting text=auto' ' - echo "<<<<<<<" >expected && - if test_have_prereq NATIVE_CRLF; then - echo first line | append_cr >>expected && - echo same line | append_cr >>expected && - echo ======= | append_cr >>expected - else - echo first line >>expected && - echo same line >>expected && - echo ======= >>expected - fi && - echo first line | append_cr >>expected && - echo same line | append_cr >>expected && - echo ">>>>>>>" >>expected && + q_to_cr <<-\EOF >expected && + <<<<<<< + first line + same line + ======= + first lineQ + same lineQ + >>>>>>> + EOF + git config merge.renormalize false && rm -f .gitattributes && git reset --hard a && @@ -125,19 +114,16 @@ test_expect_success 'Detect CRLF/LF conflict after setting text=auto' ' ' test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' ' - echo "<<<<<<<" >expected && - echo first line | append_cr >>expected && - echo same line | append_cr >>expected && - if test_have_prereq NATIVE_CRLF; then - echo ======= | append_cr >>expected && - echo first line | append_cr >>expected && - echo same line | append_cr >>expected - else - echo ======= >>expected && - echo first line >>expected && - echo same line >>expected - fi && - echo ">>>>>>>" >>expected && + q_to_cr <<-\EOF >expected && + <<<<<<< + first lineQ + same lineQ + ======= + first line + same line + >>>>>>> + EOF + git config merge.renormalize false && rm -f .gitattributes && git reset --hard b && diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 9874e45c5e..ee117e2e72 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -16,7 +16,7 @@ commit_msg () { msg="modify 2nd file (ge\303\244ndert)\n" if test -n "$1" then - printf "$msg" | iconv -t "$1" + printf "$msg" | iconv -f utf-8 -t "$1" else printf "$msg" fi @@ -60,7 +60,7 @@ check_changes () { test_expect_success 'reset --hard message' ' hex=$(git log -1 --format="%h") && git reset --hard > .actual && - echo HEAD is now at $hex $(commit_msg utf-8) > .expected && + echo HEAD is now at $hex $(commit_msg) > .expected && test_cmp .expected .actual ' diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh index e42c70bed0..7ca10b8606 100755 --- a/t/t7407-submodule-foreach.sh +++ b/t/t7407-submodule-foreach.sh @@ -77,10 +77,6 @@ test_expect_success 'test basic "submodule foreach" usage' ' git config foo.bar zar && git submodule foreach "git config --file \"\$toplevel/.git/config\" foo.bar" ) && - if test_have_prereq MINGW - then - dos2unix actual - fi && test_i18ncmp expect actual ' @@ -178,10 +174,6 @@ test_expect_success 'test messages from "foreach --recursive"' ' cd clone2 && git submodule foreach --recursive "true" > ../actual ) && - if test_have_prereq MINGW - then - dos2unix actual - fi && test_i18ncmp expect actual ' @@ -200,10 +192,6 @@ test_expect_success 'test "foreach --quiet --recursive"' ' cd clone2 && git submodule foreach -q --recursive "echo \$name-\$path" > ../actual ) && - if test_have_prereq MINGW - then - dos2unix actual - fi && test_cmp expect actual ' @@ -251,10 +239,6 @@ test_expect_success 'test "status --recursive"' ' cd clone3 && git submodule status --recursive > ../actual ) && - if test_have_prereq MINGW - then - dos2unix actual - fi && test_cmp expect actual ' diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index 78b12ad21e..5a193c500d 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -253,7 +253,7 @@ test_expect_success PERL 'difftool --extcmd echo arg1' ' echo file >expect && git difftool --no-prompt \ --extcmd sh\ -c\ \"echo\ \$1\" branch >actual && - test_cmp_text expect actual + test_cmp expect actual ' test_expect_success PERL 'difftool --extcmd cat arg1' ' @@ -394,14 +394,14 @@ run_dir_diff_test 'difftool --dir-diff syncs worktree with unstaged change' ' echo "orig content" >file && git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch && echo "new content" >expect && - test_cmp_text expect file + test_cmp expect file ' run_dir_diff_test 'difftool --dir-diff syncs worktree without unstaged change' ' test_when_finished git reset --hard && git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch && echo "new content" >expect && - test_cmp_text expect file + test_cmp expect file ' write_script modify-file <<\EOF @@ -412,7 +412,7 @@ test_expect_success PERL 'difftool --no-symlinks does not overwrite working tree echo "orig content" >file && git difftool --dir-diff --no-symlinks --extcmd "$(pwd)/modify-file" branch && echo "new content" >expect && - test_cmp_text expect file + test_cmp expect file ' write_script modify-both-files <<\EOF @@ -428,9 +428,9 @@ test_expect_success PERL 'difftool --no-symlinks detects conflict ' ' echo "orig content" >file && test_must_fail git difftool --dir-diff --no-symlinks --extcmd "$(pwd)/modify-both-files" branch && echo "wt content" >expect && - test_cmp_text expect file && + test_cmp expect file && echo "tmp content" >expect && - test_cmp_text expect "$(cat tmpdir)/file" + test_cmp expect "$(cat tmpdir)/file" ) ' diff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh index a6e73d0635..cb390559f9 100755 --- a/t/t8005-blame-i18n.sh +++ b/t/t8005-blame-i18n.sh @@ -33,7 +33,7 @@ author $SJIS_NAME summary $SJIS_MSG EOF -test_expect_success NOT_MINGW \ +test_expect_success \ 'blame respects i18n.commitencoding' ' git blame --incremental file | \ egrep "^(author|summary) " > actual && @@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME summary $EUC_JAPAN_MSG EOF -test_expect_success NOT_MINGW \ +test_expect_success \ 'blame respects i18n.logoutputencoding' ' git config i18n.logoutputencoding eucJP && git blame --incremental file | \ @@ -66,7 +66,7 @@ author $UTF8_NAME summary $UTF8_MSG EOF -test_expect_success NOT_MINGW \ +test_expect_success \ 'blame respects --encoding=UTF-8' ' git blame --incremental --encoding=UTF-8 file | \ egrep "^(author|summary) " > actual && @@ -82,7 +82,7 @@ author $UTF8_NAME summary $UTF8_MSG EOF -test_expect_success NOT_MINGW \ +test_expect_success \ 'blame respects --encoding=none' ' git blame --incremental --encoding=none file | \ egrep "^(author|summary) " > actual && diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index d680aa6313..3119c8c523 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -96,7 +96,7 @@ EOF test_expect_success $PREREQ \ 'Verify commandline' \ - 'test_cmp_text expected commandline1' + 'test_cmp expected commandline1' test_expect_success $PREREQ 'Send patches with --envelope-sender' ' clean_fake_sendmail && @@ -116,7 +116,7 @@ EOF test_expect_success $PREREQ \ 'Verify commandline' \ - 'test_cmp_text expected commandline1' + 'test_cmp expected commandline1' test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' ' clean_fake_sendmail && @@ -136,7 +136,7 @@ EOF test_expect_success $PREREQ \ 'Verify commandline' \ - 'test_cmp_text expected commandline1' + 'test_cmp expected commandline1' test_expect_success $PREREQ 'setup expect' " cat >expected-show-all-headers <<\EOF @@ -260,7 +260,7 @@ test_expect_success $PREREQ 'Show all headers' ' -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ >actual-show-all-headers && - test_cmp_text expected-show-all-headers actual-show-all-headers + test_cmp expected-show-all-headers actual-show-all-headers ' test_expect_success $PREREQ 'Prompting works' ' @@ -428,13 +428,13 @@ test_expect_success $PREREQ 'In-Reply-To without --chain-reply-to' ' 2>errors && # The first message is a reply to --in-reply-to sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual && - test_cmp_text expect actual && + test_cmp expect actual && # Second and subsequent messages are replies to the first one sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect && sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual && - test_cmp_text expect actual && + test_cmp expect actual && sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual && - test_cmp_text expect actual + test_cmp expect actual ' test_expect_success $PREREQ 'In-Reply-To with --chain-reply-to' ' @@ -449,13 +449,13 @@ test_expect_success $PREREQ 'In-Reply-To with --chain-reply-to' ' $patches $patches $patches \ 2>errors && sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt1 >actual && - test_cmp_text expect actual && + test_cmp expect actual && sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt1 >expect && sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt2 >actual && - test_cmp_text expect actual && + test_cmp expect actual && sed -n -e "s/^Message-Id: *\(.*\)/\1/p" msgtxt2 >expect && sed -n -e "s/^In-Reply-To: *\(.*\)/\1/p" msgtxt3 >actual && - test_cmp_text expect actual + test_cmp expect actual ' test_expect_success $PREREQ 'setup fake editor' ' @@ -527,7 +527,7 @@ test_suppression () { -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ >actual-suppress-$1${2+"-$2"} && - test_cmp_text expected-suppress-$1${2+"-$2"} actual-suppress-$1${2+"-$2"} + test_cmp expected-suppress-$1${2+"-$2"} actual-suppress-$1${2+"-$2"} } test_expect_success $PREREQ 'sendemail.cc set' ' @@ -1243,7 +1243,7 @@ test_expect_success $PREREQ 'asks about and fixes 8bit encodings' ' grep email-using-8bit stdout && grep "Which 8bit encoding" stdout && egrep "Content|MIME" msgtxt1 >actual && - test_cmp_text actual content-type-decl + test_cmp actual content-type-decl ' test_expect_success $PREREQ 'sendemail.8bitEncoding works' ' @@ -1254,7 +1254,7 @@ test_expect_success $PREREQ 'sendemail.8bitEncoding works' ' --smtp-server="$(pwd)/fake.sendmail" \ email-using-8bit >stdout && egrep "Content|MIME" msgtxt1 >actual && - test_cmp_text actual content-type-decl + test_cmp actual content-type-decl ' test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' ' @@ -1266,7 +1266,7 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' ' --8bit-encoding=UTF-8 \ email-using-8bit >stdout && egrep "Content|MIME" msgtxt1 >actual && - test_cmp_text actual content-type-decl + test_cmp actual content-type-decl ' test_expect_success $PREREQ 'setup expect' ' @@ -1295,7 +1295,7 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' ' --8bit-encoding=UTF-8 \ email-using-8bit >stdout && grep "Subject" msgtxt1 >actual && - test_cmp_text expected actual + test_cmp expected actual ' # Note that the patches in this test are deliberately out of order; we diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index fe5181dbf8..2312dec8f0 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -504,15 +504,4 @@ test_expect_success 'refs are updated even if no commits need to be exported' ' test_cmp expected actual ' -cat > expected << EOF -reset refs/heads/master -from $(git rev-parse master) - -EOF - -test_expect_failure 'refs are updated even if no commits need to be exported' ' - git fast-export master..master > actual && - test_cmp expected actual -' - test_done diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index e3319c8592..2d4beb5e50 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -212,18 +212,9 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' ' ) ' -function pwd_P_W () { - if test_have_prereq MINGW - then - pwd -W - else - pwd -P - fi -} - test_expect_success '__gitdir - gitfile in cwd' ' - echo "$(pwd_P_W)/otherrepo/.git" >expected && - echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git && + echo "$(pwd -P)/otherrepo/.git" >expected && + echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git && test_when_finished "rm -f subdir/.git" && ( cd subdir && @@ -233,8 +224,8 @@ test_expect_success '__gitdir - gitfile in cwd' ' ' test_expect_success '__gitdir - gitfile in parent' ' - echo "$(pwd_P_W)/otherrepo/.git" >expected && - echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git && + echo "$(pwd -P)/otherrepo/.git" >expected && + echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git && test_when_finished "rm -f subdir/.git" && ( cd subdir/subsubdir && diff --git a/t/test-lib.sh b/t/test-lib.sh index 1ddee3345c..3c7cb1d774 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -15,10 +15,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/ . -# for git on windows so stdin will not be misdetected as attached to a -# terminal -exec < /dev/null - # Keep the original TERM for say_color ORIGINAL_TERM=$TERM @@ -754,7 +750,6 @@ case $(uname -s) in # exec does not inherit the PID test_set_prereq MINGW test_set_prereq NOT_CYGWIN - test_set_prereq NATIVE_CRLF test_set_prereq SED_STRIPS_CR test_set_prereq GREP_STRIPS_CR GIT_TEST_CMP=mingw_test_cmp @@ -792,24 +787,12 @@ else test_set_prereq C_LOCALE_OUTPUT fi -# Use this instead of test_cmp to compare files that are expected to contain -# text (and therefore it should not matter whether the line ends in an LF or -# a CR/LF). -test_cmp_text () { - if test_have_prereq MINGW - then - dos2unix "$1" && - dos2unix "$2" - fi && - test_cmp "$@" -} - # Use this instead of test_cmp to compare files that contain expected and # actual output from git commands that can be translated. When running # under GETTEXT_POISON this pretends that the command produced expected # results. test_i18ncmp () { - test -n "$GETTEXT_POISON" || test_cmp_text "$@" + test -n "$GETTEXT_POISON" || test_cmp "$@" } # Use this instead of "grep expected-string actual" to see if the -- 2.11.4.GIT