{"thread":{"id":"19300","subject":"(unknown)","startedAt":"2009-05-11T18:57:12Z","lastAt":"2009-05-12T12:45:47Z","messageCount":3,"participants":["Don Slutz","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113568","messageId":"200905111857.n4BIvCNQ002319@krl.krl.com","threadId":"19300","inReplyTo":null,"subject":"(unknown)","fromName":"Don Slutz","fromEmail":"slutz@krl.com","sentAt":"2009-05-11T18:57:12Z","receivedAt":"2009-05-11T18:57:12Z","isPatch":false,"sender":{"key":"slutz@krl.com","avatar":null},"body":">From 96607bf6ffca78c88278e206ed40dce3abc1d4d9 Mon Sep 17 00:00:00 2001\nFrom: Don Slutz <Don.Slutz@SierraAtlantic.com>\nDate: Mon, 11 May 2009 11:58:32 -0400\nSubject: [PATCH 3/6] Fix tests to work with core.autocrlf=true\n\nUse the new functions to fix tests.\n\nSigned-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>\n---\n t/t0002-gitfile.sh                        |    3 +-\n t/t2004-checkout-cache-temp.sh            |   42 ++++++++++++++--------------\n t/t2008-checkout-subdir.sh                |   14 +++++-----\n t/t3404-rebase-interactive.sh             |    2 +-\n t/t3410-rebase-preserve-dropped-merges.sh |   12 ++++----\n t/t3413-rebase-hook.sh                    |   32 +++++++++++-----------\n t/t3503-cherry-pick-root.sh               |    2 +-\n t/t3903-stash.sh                          |   12 ++++----\n t/t4102-apply-rename.sh                   |    5 ++-\n t/t4124-apply-ws-rule.sh                  |   23 ++++++++++++---\n t/t4125-apply-ws-fuzz.sh                  |    9 +++++-\n t/t4128-apply-root.sh                     |    8 +++---\n t/t4150-am.sh                             |    4 +-\n t/t4252-am-options.sh                     |   16 ++++++++---\n t/t5000-tar-tree.sh                       |   12 +++++---\n t/t5001-archive-attr.sh                   |    3 ++\n t/t5520-pull.sh                           |   12 ++++----\n t/t7003-filter-branch.sh                  |    4 +-\n t/t7201-co.sh                             |    2 +-\n t/t7402-submodule-rebase.sh               |    4 +-\n t/t7610-mergetool.sh                      |    6 ++--\n t/t7800-difftool.sh                       |   13 +++++----\n t/t9700-perl-git.sh                       |    2 +-\n 23 files changed, 139 insertions(+), 103 deletions(-)\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nindex cb14425..3762714 100755\n--- a/t/t0002-gitfile.sh\n+++ b/t/t0002-gitfile.sh\n@@ -60,7 +60,8 @@ test_expect_success 'final setup + check rev-parse --git-dir' '\n \n test_expect_success 'check hash-object' '\n \techo \"foo\" >bar &&\n-\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tSHA=$(cat bar | git hash-object -w --stdin --path=bar) &&\n+\ttest_debug \"echo SHA=$SHA\" &&\n \tobjck $SHA\n '\n \ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 36cca14..ce4c584 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -44,7 +44,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree1path1'\n+test_cat_eq $p tree1path1'\n \n test_expect_success \\\n 'checkout all stage 0 to temporary files' '\n@@ -57,7 +57,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree1$f\n+\ttest_cat_eq $p tree1$f\n done'\n \n test_expect_success \\\n@@ -73,7 +73,7 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = tree2path1'\n+test_cat_eq $p tree2path1'\n \n test_expect_success \\\n 'checkout all stage 2 to temporary files' '\n@@ -85,7 +85,7 @@ do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n \tp=$(grep $f out | cut \"-d\t\" -f1) &&\n \ttest -f $p &&\n-\ttest $(cat $p) = tree2$f\n+\ttest_cat_eq $p tree2$f\n done'\n \n test_expect_success \\\n@@ -104,9 +104,9 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n 'checkout some stages/one file to temporary files' '\n@@ -118,8 +118,8 @@ cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n 'checkout all stages/all files to temporary files' '\n@@ -138,9 +138,9 @@ grep path1 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path1 &&\n-test $(cat $s2) = tree2path1 &&\n-test $(cat $s3) = tree3path1)'\n+test_cat_eq $s1 tree1path1 &&\n+test_cat_eq $s2 tree2path1 &&\n+test_cat_eq $s3 tree3path1)'\n \n test_expect_success \\\n '-- path2: no stage 1, have stage 2 and 3' '\n@@ -149,8 +149,8 @@ grep path2 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test $s1 = . &&\n test -f $s2 &&\n test -f $s3 &&\n-test $(cat $s2) = tree2path2 &&\n-test $(cat $s3) = tree3path2)'\n+test_cat_eq $s2 tree2path2 &&\n+test_cat_eq $s3 tree3path2)'\n \n test_expect_success \\\n '-- path3: no stage 2, have stage 1 and 3' '\n@@ -159,8 +159,8 @@ grep path3 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test -f $s3 &&\n-test $(cat $s1) = tree1path3 &&\n-test $(cat $s3) = tree3path3)'\n+test_cat_eq $s1 tree1path3 &&\n+test_cat_eq $s3 tree3path3)'\n \n test_expect_success \\\n '-- path4: no stage 3, have stage 1 and 3' '\n@@ -169,8 +169,8 @@ grep path4 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test -f $s2 &&\n test $s3 = . &&\n-test $(cat $s1) = tree1path4 &&\n-test $(cat $s2) = tree2path4)'\n+test_cat_eq $s1 tree1path4 &&\n+test_cat_eq $s2 tree2path4)'\n \n test_expect_success \\\n '-- asubdir/path5: no stage 2 and 3 have stage 1' '\n@@ -179,7 +179,7 @@ grep asubdir/path5 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n test -f $s1 &&\n test $s2 = . &&\n test $s3 = . &&\n-test $(cat $s1) = tree1asubdir/path5)'\n+test_cat_eq $s1 tree1asubdir/path5)'\n \n test_expect_success \\\n 'checkout --temp within subdir' '\n@@ -191,7 +191,7 @@ test_expect_success \\\n  test -f ../$s1 &&\n  test $s2 = . &&\n  test $s3 = . &&\n- test $(cat ../$s1) = tree1asubdir/path5)\n+ test_cat_eq ../$s1 tree1asubdir/path5)\n )'\n \n test_expect_success SYMLINKS \\\n@@ -207,6 +207,6 @@ test $(wc -l <out) = 1 &&\n test $(cut \"-d\t\" -f2 out) = a &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n-test $(cat $p) = b'\n+test_cat_eq $p b'\n \n test_done\ndiff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh\nindex 3e098ab..7933197 100755\n--- a/t/t2008-checkout-subdir.sh\n+++ b/t/t2008-checkout-subdir.sh\n@@ -27,14 +27,14 @@ test_expect_success 'remove and restore with relative path' '\n \t\tcd dir1 &&\n \t\trm ../file0 &&\n \t\tgit checkout HEAD -- ../file0 &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n+\t\ttest_eq_cat base ../file0 &&\n \t\trm ../dir2/file2 &&\n \t\tgit checkout HEAD -- ../dir2/file2 &&\n-\t\ttest \"bonjour\" = \"$(cat ../dir2/file2)\" &&\n+\t\ttest_eq_cat bonjour ../dir2/file2 &&\n \t\trm ../file0 ./file1 &&\n \t\tgit checkout HEAD -- .. &&\n-\t\ttest \"base\" = \"$(cat ../file0)\" &&\n-\t\ttest \"hello\" = \"$(cat file1)\"\n+\t\ttest_eq_cat base ../file0 &&\n+\t\ttest_eq_cat hello file1\n \t)\n \n '\n@@ -43,7 +43,7 @@ test_expect_success 'checkout with empty prefix' '\n \n \trm file0 &&\n \tgit checkout HEAD -- file0 &&\n-\ttest \"base\" = \"$(cat file0)\"\n+\ttest_eq_cat base file0\n \n '\n \n@@ -51,10 +51,10 @@ test_expect_success 'checkout with simple prefix' '\n \n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\" &&\n+\ttest_eq_cat hello dir1/file1 &&\n \trm dir1/file1 &&\n \tgit checkout HEAD -- dir1/file1 &&\n-\ttest \"hello\" = \"$(cat dir1/file1)\"\n+\ttest_eq_cat hello dir1/file1\n \n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex c32ff66..6990c77 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -162,7 +162,7 @@ test_expect_success 'squash' '\n \tGIT_AUTHOR_NAME=\"Nitfol\" git commit -m \"nitfol\" file7 &&\n \techo \"******************************\" &&\n \tFAKE_LINES=\"1 squash 2\" git rebase -i --onto master HEAD~2 &&\n-\ttest B = $(cat file7) &&\n+\ttest_eq_cat B file7 &&\n \ttest $(git rev-parse HEAD^) = $(git rev-parse master)\n '\n \ndiff --git a/t/t3410-rebase-preserve-dropped-merges.sh b/t/t3410-rebase-preserve-dropped-merges.sh\nindex c49143a..a044962 100755\n--- a/t/t3410-rebase-preserve-dropped-merges.sh\n+++ b/t/t3410-rebase-preserve-dropped-merges.sh\n@@ -52,9 +52,9 @@ test_expect_success 'skip same-resolution merges with -p' '\n \ttest_commit K file7 file7 &&\n \tgit rebase -i -p L &&\n \ttest $(git rev-parse HEAD^^) = $(git rev-parse L) &&\n-\ttest \"23\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 23 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n # A - B - C - D - E\n@@ -77,9 +77,9 @@ test_expect_success 'keep different-resolution merges with -p' '\n \tgit add file1 &&\n \tgit rebase --continue &&\n \ttest $(git rev-parse HEAD^^^) = $(git rev-parse L2) &&\n-\ttest \"234\" = \"$(cat file1)\" &&\n-\ttest \"I\" = \"$(cat file6)\" &&\n-\ttest \"file7\" = \"$(cat file7)\"\n+\ttest_eq_cat 234 file1 &&\n+\ttest_eq_cat I file6 &&\n+\ttest_eq_cat file7 file7\n '\n \n test_done\ndiff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh\nindex 098b755..ac9ad05 100755\n--- a/t/t3413-rebase-hook.sh\n+++ b/t/t3413-rebase-hook.sh\n@@ -27,14 +27,14 @@ test_expect_success 'rebase' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase -i' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'setup pre-rebase hook' '\n@@ -50,8 +50,8 @@ test_expect_success 'pre-rebase hook gets correct input (1)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -59,8 +59,8 @@ test_expect_success 'pre-rebase hook gets correct input (2)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (3)' '\n@@ -68,16 +68,16 @@ test_expect_success 'pre-rebase hook gets correct input (3)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tgit rebase master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (4)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,\n \n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'pre-rebase hook gets correct input (5)' '\n \tgit checkout test &&\n \tgit reset --hard side &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'pre-rebase hook gets correct input (6)' '\n@@ -94,8 +94,8 @@ test_expect_success 'pre-rebase hook gets correct input (6)' '\n \tgit reset --hard side &&\n \tgit checkout master &&\n \tEDITOR=true git rebase -i master test &&\n-\ttest \"z$(cat git)\" = zworld &&\n-\ttest \"z$(cat .git/PRE-REBASE-INPUT)\" = zmaster,test\n+\ttest_cat_eq git world &&\n+\ttest_cat_eq .git/PRE-REBASE-INPUT master,test\n '\n \n test_expect_success 'setup pre-rebase hook that fails' '\n@@ -132,7 +132,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '\n \tgit reset --hard side &&\n \tgit rebase --no-verify master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n@@ -140,7 +140,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '\n \tgit reset --hard side &&\n \tEDITOR=true git rebase --no-verify -i master &&\n \ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/test &&\n-\ttest \"z$(cat git)\" = zworld\n+\ttest_cat_eq git world\n '\n \n test_done\ndiff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh\nindex b0faa29..dfcd72a 100755\n--- a/t/t3503-cherry-pick-root.sh\n+++ b/t/t3503-cherry-pick-root.sh\n@@ -23,7 +23,7 @@ test_expect_success setup '\n test_expect_success 'cherry-pick a root commit' '\n \n \tgit cherry-pick master &&\n-\ttest first = $(cat file1)\n+\ttest_eq_cat first file1\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 7484cbe..7c1e169 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -49,7 +49,7 @@ test_expect_success 'apply stashed changes' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -61,7 +61,7 @@ test_expect_success 'apply stashed changes (including index)' '\n \ttest_tick &&\n \tgit commit -m other-file &&\n \tgit stash apply --index &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 2 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -83,7 +83,7 @@ test_expect_success 'drop top stash' '\n \tgit stash list > stashlist2 &&\n \tdiff stashlist1 stashlist2 &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -97,13 +97,13 @@ test_expect_success 'drop middle stash' '\n \tgit stash drop stash@{1} &&\n \ttest 2 = $(git stash list | wc -l) &&\n \tgit stash apply &&\n-\ttest 9 = $(cat file) &&\n+\ttest_eq_cat 9 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \tgit reset --hard &&\n \tgit stash drop &&\n \tgit stash apply &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file)\n '\n@@ -111,7 +111,7 @@ test_expect_success 'drop middle stash' '\n test_expect_success 'stash pop' '\n \tgit reset --hard &&\n \tgit stash pop &&\n-\ttest 3 = $(cat file) &&\n+\ttest_eq_cat 3 file &&\n \ttest 1 = $(git show :file) &&\n \ttest 1 = $(git show HEAD:file) &&\n \ttest 0 = $(git stash list | wc -l)\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex 1597965..5c7300d 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -43,7 +43,7 @@ test_expect_success FILEMODE validate \\\n \n test_expect_success 'apply reverse' \\\n     'git apply -R --index --stat --summary --apply test-patch &&\n-     test \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq foo \"This is foo\"'\n \n cat >test-patch <<\\EOF\n diff --git a/foo b/bar\n@@ -59,6 +59,7 @@ EOF\n \n test_expect_success 'apply copy' \\\n     'git apply --index --stat --summary --apply test-patch &&\n-     test \"$(cat bar)\" = \"This is bar\" -a \"$(cat foo)\" = \"This is foo\"'\n+     test_cat_eq bar \"This is bar\" &&\n+     test_cat_eq foo \"This is foo\"'\n \n test_done\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex f83322e..3933dd9 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -38,13 +38,19 @@ apply_patch () {\n \tgit apply \"$@\"\n }\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_fix () {\n \n \t# fix should not barf\n \tapply_patch --whitespace=fix || return 1\n \n+\ttest_debug \"echo patch applied: [$1]\"\n \t# find touched lines\n-\tdiff file target | sed -n -e \"s/^> //p\" >fixed\n+\tremove_cr target >target1\n+\tdiff file target1 | sed -n -e \"s/^> //p\" >fixed\n \n \t# the changed lines are all expeced to change\n \tfixed_cnt=$(wc -l <fixed)\n@@ -52,6 +58,7 @@ test_fix () {\n \t'') expect_cnt=$fixed_cnt ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <fixed | wc -l) ;;\n \tesac\n+\ttest_debug \"echo fixed: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# and we are not missing anything\n@@ -59,12 +66,14 @@ test_fix () {\n \t'') expect_cnt=0 ;;\n \t?*) expect_cnt=$(grep \"[$1]\" <file | wc -l) ;;\n \tesac\n+\ttest_debug \"echo missing: $fixed_cnt vs $expect_cnt\"\n \ttest $fixed_cnt -eq $expect_cnt || return 1\n \n \t# Get the patch actually applied\n \tgit diff-files -p target >fixed-patch\n \ttest -s fixed-patch && return 0\n \n+\ttest_debug \"echo failed to apply, try and fix\"\n \t# Make sure it is complaint-free\n \t>target\n \tgit apply --whitespace=error-all <fixed-patch\n@@ -85,14 +94,16 @@ test_expect_success setup '\n test_expect_success 'whitespace=nowarn, default rule' '\n \n \tapply_patch --whitespace=nowarn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n test_expect_success 'whitespace=warn, default rule' '\n \n \tapply_patch --whitespace=warn &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -108,7 +119,8 @@ test_expect_success 'whitespace=error-all, no rule' '\n \n \tgit config core.whitespace -trailing,-space-before,-indent &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \n@@ -117,7 +129,8 @@ test_expect_success 'whitespace=error-all, no rule (attribute)' '\n \tgit config --unset core.whitespace &&\n \techo \"target -whitespace\" >.gitattributes &&\n \tapply_patch --whitespace=error-all &&\n-\tdiff file target\n+\tremove_cr target >target1 &&\n+\tdiff file target1\n \n '\n \ndiff --git a/t/t4125-apply-ws-fuzz.sh b/t/t4125-apply-ws-fuzz.sh\nindex 3b471b6..c02fe08 100755\n--- a/t/t4125-apply-ws-fuzz.sh\n+++ b/t/t4125-apply-ws-fuzz.sh\n@@ -4,6 +4,10 @@ test_description='applying patch that has broken whitespaces in context'\n \n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n test_expect_success setup '\n \n \t>file &&\n@@ -91,12 +95,13 @@ test_expect_success 'withfix (backward)' '\n \n \tsed -e /h/d file-fixed >fixed-head &&\n \tsed -e /h/d file >file-head &&\n-\ttest_cmp fixed-head file-head &&\n+\tremove_cr file-head >file-head1\n+\tdiff fixed-head file-head1 &&\n \n \tsed -n -e /h/p file-fixed >fixed-tail &&\n \tsed -n -e /h/p file >file-tail &&\n \n-\t! test_cmp fixed-tail file-tail\n+\t! diff fixed-tail file-tail\n \n '\n \ndiff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh\nindex 8f6aea4..a03a9c8 100755\n--- a/t/t4128-apply-root.sh\n+++ b/t/t4128-apply-root.sh\n@@ -27,7 +27,7 @@ test_expect_success 'apply --directory -p (1)' '\n \n \tgit apply --directory=some/sub -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -36,7 +36,7 @@ test_expect_success 'apply --directory -p (2) ' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/ -p3 --index patch &&\n \ttest Bello = $(git show :some/sub/dir/file) &&\n-\ttest Bello = $(cat some/sub/dir/file)\n+\ttest_eq_cat Bello some/sub/dir/file\n \n '\n \n@@ -54,7 +54,7 @@ test_expect_success 'apply --directory (new file)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/newfile) &&\n-\ttest content = $(cat some/sub/dir/newfile)\n+\ttest_eq_cat content some/sub/dir/newfile\n '\n \n cat > patch << EOF\n@@ -89,7 +89,7 @@ test_expect_success 'apply --directory (quoted filename)' '\n \tgit reset --hard initial &&\n \tgit apply --directory=some/sub/dir/ --index patch &&\n \ttest content = $(git show :some/sub/dir/quotefile) &&\n-\ttest content = $(cat some/sub/dir/quotefile)\n+\ttest_eq_cat content some/sub/dir/quotefile\n '\n \n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex d6ebbae..27570b7 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -190,7 +190,7 @@ test_expect_success 'am --skip works' '\n \tgit am --skip &&\n \t! test -d .git/rebase-apply &&\n \ttest -z \"$(git diff lorem2^^ -- file)\" &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am --resolved works' '\n@@ -201,7 +201,7 @@ test_expect_success 'am --resolved works' '\n \tgit add file &&\n \tgit am --resolved &&\n \t! test -d .git/rebase-apply &&\n-\ttest goodbye = \"$(cat another)\"\n+\ttest_eq_cat goodbye another\n '\n \n test_expect_success 'am takes patches from a Pine mailbox' '\ndiff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh\nindex f603c1b..342fc1a 100755\n--- a/t/t4252-am-options.sh\n+++ b/t/t4252-am-options.sh\n@@ -3,6 +3,10 @@\n test_description='git am with options and not losing them'\n . ./test-lib.sh\n \n+remove_cr () {\n+\ttr '\\015' Q <\"$1\" | sed -e 's/Q$//'\n+}\n+\n tm=\"$TEST_DIRECTORY/t4252\"\n \n test_expect_success setup '\n@@ -20,7 +24,8 @@ test_expect_success 'interrupted am --whitespace=fix' '\n \ttest_must_fail git am --whitespace=fix \"$tm\"/am-test-1-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Six$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Six$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1' '\n@@ -29,7 +34,8 @@ test_expect_success 'interrupted am -C1' '\n \ttest_must_fail git am -C1 \"$tm\"/am-test-2-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -p2' '\n@@ -38,7 +44,8 @@ test_expect_success 'interrupted am -p2' '\n \ttest_must_fail git am -p2 \"$tm\"/am-test-3-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am -C1 -p2' '\n@@ -47,7 +54,8 @@ test_expect_success 'interrupted am -C1 -p2' '\n \ttest_must_fail git am -p2 -C1 \"$tm\"/am-test-4-? &&\n \tgit am --skip &&\n \tgrep 3 file-1 &&\n-\tgrep \"^Three$\" file-2\n+\tremove_cr file-2 >file-2a &&\n+\tgrep \"^Three$\" file-2a\n '\n \n test_expect_success 'interrupted am --directory=\"frotz nitfol\"' '\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex abb41b0..28d6291 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -25,6 +25,8 @@ commit id embedding:\n '\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n+\n UNZIP=${UNZIP:-unzip}\n \n SUBSTFORMAT=%H%n\n@@ -66,6 +68,8 @@ test_expect_success \\\n     'git clone --bare . bare.git &&\n      cp .git/info/attributes bare.git/info/attributes'\n \n+test ! -z \"$autocrlf\" && (cd bare.git; git config core.autocrlf $autocrlf)\n+\n test_expect_success \\\n     'remove ignored file' \\\n     'rm a/ignored'\n@@ -118,7 +122,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents' \\\n-    'diff -r a b/a'\n+    'diff -rb a b/a'\n \n test_expect_success \\\n     'git tar-tree with prefix' \\\n@@ -135,7 +139,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'validate file contents with prefix' \\\n-    'diff -r a c/prefix/a'\n+    'diff -rb a c/prefix/a'\n \n test_expect_success \\\n     'create archives with substfiles' \\\n@@ -203,7 +207,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents' \\\n-    'diff -r a d/a'\n+    'diff -rb a d/a'\n \n test_expect_success \\\n     'git archive --format=zip with prefix' \\\n@@ -220,7 +224,7 @@ test_expect_success UNZIP \\\n \n test_expect_success UNZIP \\\n     'validate file contents with prefix' \\\n-    'diff -r a e/prefix/a'\n+    'diff -rb a e/prefix/a'\n \n test_expect_success \\\n     'git archive --list outside of a git repo' \\\ndiff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh\nindex 426b319..2efa018 100755\n--- a/t/t5001-archive-attr.sh\n+++ b/t/t5001-archive-attr.sh\n@@ -3,6 +3,7 @@\n test_description='git archive attribute tests'\n \n . ./test-lib.sh\n+autocrlf=$(git config core.autocrlf)\n \n SUBSTFORMAT=%H%n\n \n@@ -39,6 +40,8 @@ test_expect_success 'setup' '\n \tcp .git/info/attributes bare/info/attributes\n '\n \n+test ! -z \"$autocrlf\" && (cd bare; git config core.autocrlf $autocrlf)\n+\n test_expect_success 'git archive' '\n \tgit archive HEAD >archive.tar &&\n \t(mkdir archive && cd archive && \"$TAR\" xf -) <archive.tar\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 725771f..4d4e7ac 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -49,9 +49,9 @@ test_expect_success 'test . as a remote' '\n \techo updated >file &&\n \tgit commit -a -m updated &&\n \tgit checkout copy &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull &&\n-\ttest `cat file` = updated\n+\ttest_cat_eq file updated\n '\n \n test_expect_success 'the default remote . should not break explicit pull' '\n@@ -60,9 +60,9 @@ test_expect_success 'the default remote . should not break explicit pull' '\n \tgit commit -a -m modified &&\n \tgit checkout copy &&\n \tgit reset --hard HEAD^ &&\n-\ttest `cat file` = file &&\n+\ttest_cat_eq file file &&\n \tgit pull . second &&\n-\ttest `cat file` = modified\n+\ttest_cat_eq file modified\n '\n \n test_expect_success '--rebase' '\n@@ -99,8 +99,8 @@ test_expect_success '--rebase with rebased upstream' '\n \techo file > file2 &&\n \tgit commit -m to-rebase file2 &&\n \tgit pull --rebase me copy &&\n-\ttest \"conflicting modification\" = \"$(cat file)\" &&\n-\ttest file = $(cat file2)\n+\ttest_eq_cat \"conflicting modification\" file &&\n+\ttest_eq_cat file file2\n \n '\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 329c851..c6e9fb5 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -72,7 +72,7 @@ test_expect_success 'test that the file was renamed' '\n \ttest d = \"$(git show HEAD:doh --)\" &&\n \t! test -f d &&\n \ttest -f doh &&\n-\ttest d = \"$(cat doh)\"\n+\ttest_eq_cat d doh\n '\n \n test_expect_success 'rewrite, renaming a specific directory' '\n@@ -85,7 +85,7 @@ test_expect_success 'test that the directory was renamed' '\n \ttest -d diroh &&\n \t! test -d diroh/dir &&\n \ttest -f diroh/d &&\n-\ttest dir/d = \"$(cat diroh/d)\"\n+\ttest_eq_cat dir/d diroh/d\n '\n \n git tag oldD HEAD~4\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex bdb808a..62f58eb 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -434,7 +434,7 @@ test_expect_success 'checkout unmerged stage' '\n \ttest_cmp expect filf &&\n \ttest_cmp expect file &&\n \tgit checkout --theirs file &&\n-\ttest ztheirside = \"z$(cat file)\"\n+\ttest_eq_cat theirside file\n '\n \n test_expect_success 'checkout with --merge' '\ndiff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh\nindex f919c8d..8e5d747 100755\n--- a/t/t7402-submodule-rebase.sh\n+++ b/t/t7402-submodule-rebase.sh\n@@ -80,11 +80,11 @@ test_expect_success 'stash with a dirty submodule' '\n \techo new > file &&\n \tCURRENT=$(cd submodule && git rev-parse HEAD) &&\n \tgit stash &&\n-\ttest new != $(cat file) &&\n+\ttest_ne_cat new file &&\n \ttest submodule = $(git diff --name-only) &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD) &&\n \tgit stash apply &&\n-\ttest new = $(cat file) &&\n+\ttest_eq_cat new file &&\n \ttest $CURRENT = $(cd submodule && git rev-parse HEAD)\n \n '\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex e768c3e..bf39e45 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -45,9 +45,9 @@ test_expect_success 'custom mergetool' '\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool subdir/file3 >/dev/null 2>&1 ) &&\n-    test \"$(cat file1)\" = \"master updated\" &&\n-    test \"$(cat file2)\" = \"master new\" &&\n-    test \"$(cat subdir/file3)\" = \"master new sub\" &&\n+    test_cat_eq file1 \"master updated\" &&\n+    test_cat_eq file2 \"master new\" &&\n+    test_cat_eq subdir/file3 \"master new sub\" &&\n     git commit -m \"branch1 resolved with mergetool\"\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex ebdccf9..b95069a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -35,11 +35,12 @@ restore_test_defaults()\n \tunset GIT_DIFFTOOL_PROMPT\n \tunset GIT_DIFFTOOL_NO_PROMPT\n \tgit config diff.tool test-tool &&\n-\tgit config difftool.test-tool.cmd 'cat $LOCAL'\n+\tgit config difftool.test-tool.cmd \"tr '\\015' '\\012' <\\$LOCAL\"\n }\n \n prompt_given()\n {\n+\ttest_debug \"echo prompt_given:$1\"\n \tprompt=\"$1\"\n \ttest \"$prompt\" = \"Hit return to launch 'test-tool': branch\"\n }\n@@ -59,7 +60,7 @@ test_expect_success 'setup' '\n # Configure a custom difftool.<tool>.cmd and use it\n test_expect_success 'custom commands' '\n \trestore_test_defaults &&\n-\tgit config difftool.test-tool.cmd \"cat \\$REMOTE\" &&\n+\tgit config difftool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$REMOTE\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"master\" &&\n@@ -136,7 +137,7 @@ test_expect_success 'GIT_DIFFTOOL_PROMPT variable' '\n \tGIT_DIFFTOOL_PROMPT=true &&\n \texport GIT_DIFFTOOL_PROMPT &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -166,7 +167,7 @@ test_expect_success 'difftool.prompt can overridden with -y' '\n test_expect_success 'difftool.prompt can overridden with --prompt' '\n \tgit config difftool.prompt false &&\n \n-\tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -179,7 +180,7 @@ test_expect_success 'difftool last flag wins' '\n \n \trestore_test_defaults &&\n \n-\tprompt=$(echo | git difftool --no-prompt --prompt branch | tail -1) &&\n+\tprompt=$(echo | git difftool --no-prompt --prompt branch | head -3 | tail -1) &&\n \tprompt_given \"$prompt\" &&\n \n \trestore_test_defaults\n@@ -190,7 +191,7 @@ test_expect_success 'difftool last flag wins' '\n test_expect_success 'difftool + mergetool config variables' '\n \tremove_config_vars\n \tgit config merge.tool test-tool &&\n-\tgit config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n+\tgit config mergetool.test-tool.cmd \"tr '\\''\\015'\\'' '\\''\\012'\\'' <\\$LOCAL\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\ndiff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh\nindex b4ca244..76f741f 100755\n--- a/t/t9700-perl-git.sh\n+++ b/t/t9700-perl-git.sh\n@@ -42,7 +42,7 @@ test_expect_success \\\n      git config --add test.int 2k\n      '\n \n-test_external_without_stderr \\\n+test_external_with_only_warning \\\n     'Perl API' \\\n     perl \"$TEST_DIRECTORY\"/t9700/test.pl\n \n-- \n1.6.3.15.g49878\n"},{"id":"113585","messageId":"alpine.DEB.1.00.0905112247450.27348@pacific.mpi-cbg.de","threadId":"19300","inReplyTo":"200905111857.n4BIvCNQ002319@krl.krl.com","subject":"Re:","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-05-11T20:48:19Z","receivedAt":"2009-05-11T20:48:19Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nis this the new fashion, to send mails without a subject, all of a sudden \nbeing okay only because Linus responded to one?\n\nCiao,\nDscho\n"},{"id":"113630","messageId":"4A096F7B.2080502@SierraAtlantic.com","threadId":"19300","inReplyTo":"alpine.DEB.1.00.0905112247450.27348@pacific.mpi-cbg.de","subject":"Re:","fromName":"Don Slutz","fromEmail":"don.slutz@sierraatlantic.com","sentAt":"2009-05-12T12:45:47Z","receivedAt":"2009-05-12T12:45:47Z","isPatch":false,"sender":{"key":"don.slutz@sierraatlantic.com","avatar":null},"body":"Nope.  It was a mistake.  The local try worked, but the send to the \nmaillist did not.  Sorry about this.\n   -Don\n\n-------- Original Message --------\nSubject: Re:\nFrom: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nTo: Don Slutz <slutz@krl.com>\nCC: git@vger.kernel.org\nDate: 5/11/2009 4:48 PM\n> Hi,\n>\n> is this the new fashion, to send mails without a subject, all of a sudden \n> being okay only because Linus responded to one?\n>\n> Ciao,\n> Dscho\n>\n>\n>   \n\n\n\n__________________________________________________________________________________________________________________\nDISCLAIMER:\"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation.\" \n________________________________________________________________________________________________________________\n"}]}