t4012: modernize style for quoting
This quoting style is used by all newly added test code. Signed-off-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexander Strasser committed
Jul 12, 2012 at 00:12 UTC
1358bb496fb182d8047a039f09c3859364cea2b4
1 file changed
+20
-15
t/t4012-diff-binary.sh
+20
-15
@@ -15,13 +15,14 @@ cat >expect.binary-numstat <<\EOF
15
- - d
16
EOF
17
18
-test_expect_success 'prepare repository' \
19
- 'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
18
+test_expect_success 'prepare repository' '
19
+ echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
20
git update-index --add a b c d &&
21
echo git >a &&
22
cat "$TEST_DIRECTORY"/test-binary-1.png >b &&
23
echo git >c &&
24
- cat b b >d'
24
+ cat b b >d
25
+'
26
27
cat > expected <<\EOF
28
a | 2 +-
@@ -62,8 +63,8 @@ test_expect_success 'apply --numstat understands diff --binary format' '
63
64
# apply needs to be able to skip the binary material correctly
65
# in order to report the line number of a corrupt patch.
65
-test_expect_success 'apply detecting corrupt patch correctly' \
66
- 'git diff | sed -e 's/-CIT/xCIT/' >broken &&
66
+test_expect_success 'apply detecting corrupt patch correctly' '
67
+ git diff | sed -e 's/-CIT/xCIT/' >broken &&
68
if git apply --stat --summary broken 2>detected
69
then
70
echo unhappy - should have detected an error
@@ -74,10 +75,11 @@ test_expect_success 'apply detecting corrupt patch correctly' \
75
detected=`cat detected` &&
76
detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
77
detected=`sed -ne "${detected}p" broken` &&
77
- test "$detected" = xCIT'
78
+ test "$detected" = xCIT
79
+'
80
79
-test_expect_success 'apply detecting corrupt patch correctly' \
80
- 'git diff --binary | sed -e 's/-CIT/xCIT/' >broken &&
81
+test_expect_success 'apply detecting corrupt patch correctly' '
82
+ git diff --binary | sed -e 's/-CIT/xCIT/' >broken &&
83
if git apply --stat --summary broken 2>detected
84
then
85
echo unhappy - should have detected an error
@@ -88,23 +90,26 @@ test_expect_success 'apply detecting corrupt patch correctly' \
90
detected=`cat detected` &&
91
detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
92
detected=`sed -ne "${detected}p" broken` &&
91
- test "$detected" = xCIT'
93
+ test "$detected" = xCIT
94
+'
95
96
test_expect_success 'initial commit' 'git commit -a -m initial'
97
98
# Try removal (b), modification (d), and creation (e).
96
-test_expect_success 'diff-index with --binary' \
97
- 'echo AIT >a && mv b e && echo CIT >c && cat e >d &&
99
+test_expect_success 'diff-index with --binary' '
100
+ echo AIT >a && mv b e && echo CIT >c && cat e >d &&
101
git update-index --add --remove a b c d e &&
102
tree0=`git write-tree` &&
103
git diff --cached --binary >current &&
101
- git apply --stat --summary current'
104
+ git apply --stat --summary current
105
+'
106
103
-test_expect_success 'apply binary patch' \
104
- 'git reset --hard &&
107
+test_expect_success 'apply binary patch' '
108
+ git reset --hard &&
109
git apply --binary --index <current &&
110
tree1=`git write-tree` &&
107
- test "$tree1" = "$tree0"'
111
+ test "$tree1" = "$tree0"
112
+'
113
114
test_expect_success 'diff --no-index with binary creation' '
115
echo Q | q_to_nul >binary &&