@@ -46,7 +46,7 @@ test_expect_success setup '
46
46
47
47
test_expect_success ' cherry-pick persists data on failure' '
48
48
pristine_detach initial &&
49
- test_must_fail git cherry-pick -s base..anotherpick &&
49
+ test_expect_code 1 git cherry-pick -s base..anotherpick &&
50
50
test_path_is_dir .git/sequencer &&
51
51
test_path_is_file .git/sequencer/head &&
52
52
test_path_is_file .git/sequencer/todo &&
@@ -67,7 +67,7 @@ test_expect_success 'cherry-pick mid-cherry-pick-sequence' '
67
67
68
68
test_expect_success ' cherry-pick persists opts correctly' '
69
69
pristine_detach initial &&
70
- test_must_fail git cherry-pick -s -m 1 --strategy=recursive -X patience -X ours base..anotherpick &&
70
+ test_expect_code 128 git cherry-pick -s -m 1 --strategy=recursive -X patience -X ours base..anotherpick &&
71
71
test_path_is_dir .git/sequencer &&
72
72
test_path_is_file .git/sequencer/head &&
73
73
test_path_is_file .git/sequencer/todo &&
@@ -107,7 +107,7 @@ test_expect_success '--abort requires cherry-pick in progress' '
107
107
108
108
test_expect_success ' --quit cleans up sequencer state' '
109
109
pristine_detach initial &&
110
- test_must_fail git cherry-pick base..picked &&
110
+ test_expect_code 1 git cherry-pick base..picked &&
111
111
git cherry-pick --quit &&
112
112
test_path_is_missing .git/sequencer
113
113
'
@@ -121,7 +121,7 @@ test_expect_success '--quit keeps HEAD and conflicted index intact' '
121
121
:000000 100644 OBJID OBJID A foo
122
122
:000000 100644 OBJID OBJID A unrelated
123
123
EOF
124
- test_must_fail git cherry-pick base..picked &&
124
+ test_expect_code 1 git cherry-pick base..picked &&
125
125
git cherry-pick --quit &&
126
126
test_path_is_missing .git/sequencer &&
127
127
test_must_fail git update-index --refresh &&
@@ -135,7 +135,7 @@ test_expect_success '--quit keeps HEAD and conflicted index intact' '
135
135
136
136
test_expect_success ' --abort to cancel multiple cherry-pick' '
137
137
pristine_detach initial &&
138
- test_must_fail git cherry-pick base..anotherpick &&
138
+ test_expect_code 1 git cherry-pick base..anotherpick &&
139
139
git cherry-pick --abort &&
140
140
test_path_is_missing .git/sequencer &&
141
141
test_cmp_rev initial HEAD &&
@@ -145,7 +145,7 @@ test_expect_success '--abort to cancel multiple cherry-pick' '
145
145
146
146
test_expect_success ' --abort to cancel single cherry-pick' '
147
147
pristine_detach initial &&
148
- test_must_fail git cherry-pick picked &&
148
+ test_expect_code 1 git cherry-pick picked &&
149
149
git cherry-pick --abort &&
150
150
test_path_is_missing .git/sequencer &&
151
151
test_cmp_rev initial HEAD &&
@@ -155,7 +155,7 @@ test_expect_success '--abort to cancel single cherry-pick' '
155
155
156
156
test_expect_success ' cherry-pick --abort to cancel multiple revert' '
157
157
pristine_detach anotherpick &&
158
- test_must_fail git revert base..picked &&
158
+ test_expect_code 1 git revert base..picked &&
159
159
git cherry-pick --abort &&
160
160
test_path_is_missing .git/sequencer &&
161
161
test_cmp_rev anotherpick HEAD &&
@@ -165,15 +165,15 @@ test_expect_success 'cherry-pick --abort to cancel multiple revert' '
165
165
166
166
test_expect_success ' revert --abort works, too' '
167
167
pristine_detach anotherpick &&
168
- test_must_fail git revert base..picked &&
168
+ test_expect_code 1 git revert base..picked &&
169
169
git revert --abort &&
170
170
test_path_is_missing .git/sequencer &&
171
171
test_cmp_rev anotherpick HEAD
172
172
'
173
173
174
174
test_expect_success ' --abort to cancel single revert' '
175
175
pristine_detach anotherpick &&
176
- test_must_fail git revert picked &&
176
+ test_expect_code 1 git revert picked &&
177
177
git revert --abort &&
178
178
test_path_is_missing .git/sequencer &&
179
179
test_cmp_rev anotherpick HEAD &&
@@ -184,7 +184,7 @@ test_expect_success '--abort to cancel single revert' '
184
184
test_expect_success ' --abort keeps unrelated change, easy case' '
185
185
pristine_detach unrelatedpick &&
186
186
echo changed >expect &&
187
- test_must_fail git cherry-pick picked..yetanotherpick &&
187
+ test_expect_code 1 git cherry-pick picked..yetanotherpick &&
188
188
echo changed >unrelated &&
189
189
git cherry-pick --abort &&
190
190
test_cmp expect unrelated
@@ -193,7 +193,7 @@ test_expect_success '--abort keeps unrelated change, easy case' '
193
193
test_expect_success ' --abort refuses to clobber unrelated change, harder case' '
194
194
pristine_detach initial &&
195
195
echo changed >expect &&
196
- test_must_fail git cherry-pick base..anotherpick &&
196
+ test_expect_code 1 git cherry-pick base..anotherpick &&
197
197
echo changed >unrelated &&
198
198
test_must_fail git cherry-pick --abort &&
199
199
test_cmp expect unrelated &&
@@ -208,7 +208,7 @@ test_expect_success '--abort refuses to clobber unrelated change, harder case' '
208
208
209
209
test_expect_success ' cherry-pick still writes sequencer state when one commit is left' '
210
210
pristine_detach initial &&
211
- test_must_fail git cherry-pick base..picked &&
211
+ test_expect_code 1 git cherry-pick base..picked &&
212
212
test_path_is_dir .git/sequencer &&
213
213
echo "resolved" >foo &&
214
214
git add foo &&
@@ -232,7 +232,7 @@ test_expect_success 'cherry-pick still writes sequencer state when one commit is
232
232
233
233
test_expect_success ' --abort after last commit in sequence' '
234
234
pristine_detach initial &&
235
- test_must_fail git cherry-pick base..picked &&
235
+ test_expect_code 1 git cherry-pick base..picked &&
236
236
git cherry-pick --abort &&
237
237
test_path_is_missing .git/sequencer &&
238
238
test_cmp_rev initial HEAD &&
@@ -242,22 +242,22 @@ test_expect_success '--abort after last commit in sequence' '
242
242
243
243
test_expect_success ' cherry-pick does not implicitly stomp an existing operation' '
244
244
pristine_detach initial &&
245
- test_must_fail git cherry-pick base..anotherpick &&
245
+ test_expect_code 1 git cherry-pick base..anotherpick &&
246
246
test-chmtime -v +0 .git/sequencer >expect &&
247
- test_must_fail git cherry-pick unrelatedpick &&
247
+ test_expect_code 128 git cherry-pick unrelatedpick &&
248
248
test-chmtime -v +0 .git/sequencer >actual &&
249
249
test_cmp expect actual
250
250
'
251
251
252
252
test_expect_success ' --continue complains when no cherry-pick is in progress' '
253
253
pristine_detach initial &&
254
- test_must_fail git cherry-pick --continue
254
+ test_expect_code 128 git cherry-pick --continue
255
255
'
256
256
257
257
test_expect_success ' --continue complains when there are unresolved conflicts' '
258
258
pristine_detach initial &&
259
- test_must_fail git cherry-pick base..anotherpick &&
260
- test_must_fail git cherry-pick --continue
259
+ test_expect_code 1 git cherry-pick base..anotherpick &&
260
+ test_expect_code 128 git cherry-pick --continue
261
261
'
262
262
263
263
test_expect_success ' --continue of single cherry-pick' '
@@ -321,7 +321,7 @@ test_expect_success '--continue after resolving conflicts' '
321
321
322
322
test_expect_success ' --continue after resolving conflicts and committing' '
323
323
pristine_detach initial &&
324
- test_must_fail git cherry-pick base..anotherpick &&
324
+ test_expect_code 1 git cherry-pick base..anotherpick &&
325
325
echo "c" >foo &&
326
326
git add foo &&
327
327
git commit &&
@@ -371,7 +371,7 @@ test_expect_success 'follow advice and skip nil patch' '
371
371
372
372
test_expect_success ' --continue respects opts' '
373
373
pristine_detach initial &&
374
- test_must_fail git cherry-pick -x base..anotherpick &&
374
+ test_expect_code 1 git cherry-pick -x base..anotherpick &&
375
375
echo "c" >foo &&
376
376
git add foo &&
377
377
git commit &&
@@ -412,7 +412,7 @@ test_expect_success '--continue respects -x in first commit in multi-pick' '
412
412
413
413
test_expect_success ' --signoff is not automatically propagated to resolved conflict' '
414
414
pristine_detach initial &&
415
- test_must_fail git cherry-pick --signoff base..anotherpick &&
415
+ test_expect_code 1 git cherry-pick --signoff base..anotherpick &&
416
416
echo "c" >foo &&
417
417
git add foo &&
418
418
git commit &&
@@ -456,24 +456,24 @@ test_expect_success 'sign-off needs to be reaffirmed after conflict resolution,
456
456
457
457
test_expect_success ' malformed instruction sheet 1' '
458
458
pristine_detach initial &&
459
- test_must_fail git cherry-pick base..anotherpick &&
459
+ test_expect_code 1 git cherry-pick base..anotherpick &&
460
460
echo "resolved" >foo &&
461
461
git add foo &&
462
462
git commit &&
463
463
sed "s/pick /pick/" .git/sequencer/todo >new_sheet &&
464
464
cp new_sheet .git/sequencer/todo &&
465
- test_must_fail git cherry-pick --continue
465
+ test_expect_code 128 git cherry-pick --continue
466
466
'
467
467
468
468
test_expect_success ' malformed instruction sheet 2' '
469
469
pristine_detach initial &&
470
- test_must_fail git cherry-pick base..anotherpick &&
470
+ test_expect_code 1 git cherry-pick base..anotherpick &&
471
471
echo "resolved" >foo &&
472
472
git add foo &&
473
473
git commit &&
474
474
sed "s/pick/revert/" .git/sequencer/todo >new_sheet &&
475
475
cp new_sheet .git/sequencer/todo &&
476
- test_must_fail git cherry-pick --continue
476
+ test_expect_code 128 git cherry-pick --continue
477
477
'
478
478
479
479
test_expect_success ' empty commit set' '
@@ -483,18 +483,18 @@ test_expect_success 'empty commit set' '
483
483
484
484
test_expect_success ' malformed instruction sheet 3' '
485
485
pristine_detach initial &&
486
- test_must_fail git cherry-pick base..anotherpick &&
486
+ test_expect_code 1 git cherry-pick base..anotherpick &&
487
487
echo "resolved" >foo &&
488
488
git add foo &&
489
489
git commit &&
490
490
sed "s/pick \([0-9a-f]*\)/pick $_r10/" .git/sequencer/todo >new_sheet &&
491
491
cp new_sheet .git/sequencer/todo &&
492
- test_must_fail git cherry-pick --continue
492
+ test_expect_code 128 git cherry-pick --continue
493
493
'
494
494
495
495
test_expect_success ' instruction sheet, fat-fingers version' '
496
496
pristine_detach initial &&
497
- test_must_fail git cherry-pick base..anotherpick &&
497
+ test_expect_code 1 git cherry-pick base..anotherpick &&
498
498
echo "c" >foo &&
499
499
git add foo &&
500
500
git commit &&
@@ -505,7 +505,7 @@ test_expect_success 'instruction sheet, fat-fingers version' '
505
505
506
506
test_expect_success ' commit descriptions in insn sheet are optional' '
507
507
pristine_detach initial &&
508
- test_must_fail git cherry-pick base..anotherpick &&
508
+ test_expect_code 1 git cherry-pick base..anotherpick &&
509
509
echo "c" >foo &&
510
510
git add foo &&
511
511
git commit &&
0 commit comments