69
test_cmp expected-s actual-s
70
'
71
72
-test_expect_failure 'alias user-defined tformat with %s (utf-8 encoding)' '
72
+test_expect_success 'alias user-defined tformat with %s (utf-8 encoding)' '
73
git log --oneline >expected-s &&
74
git log --pretty="tformat:%h %s" >actual-s &&
75
test_cmp expected-s actual-s
108
test_must_fail git log --pretty=test-foo
109
'
110
111
-test_expect_failure 'NUL separation' '
111
+test_expect_success 'NUL separation' '
112
printf "add bar\0$(commit_msg)" >expected &&
113
git log -z --pretty="format:%s" >actual &&
114
test_cmp expected actual
115
'
116
117
-test_expect_failure 'NUL termination' '
117
+test_expect_success 'NUL termination' '
118
printf "add bar\0$(commit_msg)\0" >expected &&
119
git log -z --pretty="tformat:%s" >actual &&
120
test_cmp expected actual
121
'
122
123
-test_expect_failure 'NUL separation with --stat' '
123
+test_expect_success 'NUL separation with --stat' '
124
stat0_part=$(git diff --stat HEAD^ HEAD) &&
125
stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&
126
printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n" >expected &&
145
head4=$(git rev-parse --verify --short HEAD~3)
146
'
147
148
-test_expect_failure 'left alignment formatting' "
148
+test_expect_success 'left alignment formatting' "
149
git log --pretty='format:%<(40)%s' >actual &&
150
# complete the incomplete line at the end
151
echo >>actual &&
158
test_cmp expected actual
159
"
160
161
-test_expect_failure 'left alignment formatting at the nth column' "
161
+test_expect_success 'left alignment formatting at the nth column' "
162
git log --pretty='format:%h %<|(40)%s' >actual &&
163
# complete the incomplete line at the end
164
echo >>actual &&
171
test_cmp expected actual
172
"
173
174
-test_expect_failure 'left alignment formatting with no padding' "
174
+test_expect_success 'left alignment formatting with no padding' "
175
git log --pretty='format:%<(1)%s' >actual &&
176
# complete the incomplete line at the end
177
echo >>actual &&
184
test_cmp expected actual
185
"
186
187
-test_expect_failure 'left alignment formatting with trunc' "
187
+test_expect_success 'left alignment formatting with trunc' "
188
git log --pretty='format:%<(10,trunc)%s' >actual &&
189
# complete the incomplete line at the end
190
echo >>actual &&
197
test_cmp expected actual
198
"
199
200
-test_expect_failure 'left alignment formatting with ltrunc' "
200
+test_expect_success 'left alignment formatting with ltrunc' "
201
git log --pretty='format:%<(10,ltrunc)%s' >actual &&
202
# complete the incomplete line at the end
203
echo >>actual &&
210
test_cmp expected actual
211
"
212
213
-test_expect_failure 'left alignment formatting with mtrunc' "
213
+test_expect_success 'left alignment formatting with mtrunc' "
214
git log --pretty='format:%<(10,mtrunc)%s' >actual &&
215
# complete the incomplete line at the end
216
echo >>actual &&
223
test_cmp expected actual
224
"
225
226
-test_expect_failure 'right alignment formatting' "
226
+test_expect_success 'right alignment formatting' "
227
git log --pretty='format:%>(40)%s' >actual &&
228
# complete the incomplete line at the end
229
echo >>actual &&
236
test_cmp expected actual
237
"
238
239
-test_expect_failure 'right alignment formatting at the nth column' "
239
+test_expect_success 'right alignment formatting at the nth column' "
240
git log --pretty='format:%h %>|(40)%s' >actual &&
241
# complete the incomplete line at the end
242
echo >>actual &&
249
test_cmp expected actual
250
"
251
252
-test_expect_failure 'right alignment formatting with no padding' "
252
+test_expect_success 'right alignment formatting with no padding' "
253
git log --pretty='format:%>(1)%s' >actual &&
254
# complete the incomplete line at the end
255
echo >>actual &&
262
test_cmp expected actual
263
"
264
265
-test_expect_failure 'center alignment formatting' "
265
+test_expect_success 'center alignment formatting' "
266
git log --pretty='format:%><(40)%s' >actual &&
267
# complete the incomplete line at the end
268
echo >>actual &&
275
test_cmp expected actual
276
"
277
278
-test_expect_failure 'center alignment formatting at the nth column' "
278
+test_expect_success 'center alignment formatting at the nth column' "
279
git log --pretty='format:%h %><|(40)%s' >actual &&
280
# complete the incomplete line at the end
281
echo >>actual &&
288
test_cmp expected actual
289
"
290
291
-test_expect_failure 'center alignment formatting with no padding' "
291
+test_expect_success 'center alignment formatting with no padding' "
292
git log --pretty='format:%><(1)%s' >actual &&
293
# complete the incomplete line at the end
294
echo >>actual &&
301
test_cmp expected actual
302
"
303
304
-test_expect_failure 'left/right alignment formatting with stealing' "
304
+test_expect_success 'left/right alignment formatting with stealing' "
305
git commit --amend -m short --author 'long long long <long@me.com>' &&
306
git log --pretty='format:%<(10,trunc)%s%>>(10,ltrunc)% an' >actual &&
307
# complete the incomplete line at the end