File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -351,11 +351,15 @@ test_expect_success 'test --format long' '
351
351
test_cmp expected actual
352
352
'
353
353
354
- test_expect_success ' setup a fake editor ' '
355
- write_script fakeeditor <<-\EOF
354
+ test_expect_success ' setup fake editors ' '
355
+ write_script fakeeditor <<-\EOF &&
356
356
sed -e "s/A U Thor/A fake Thor/" "$1" >"$1.new"
357
357
mv "$1.new" "$1"
358
358
EOF
359
+ write_script failingfakeeditor <<-\EOF
360
+ ./fakeeditor "$@"
361
+ false
362
+ EOF
359
363
'
360
364
361
365
test_expect_success ' --edit with and without already replaced object' '
@@ -372,7 +376,7 @@ test_expect_success '--edit with and without already replaced object' '
372
376
test_expect_success ' --edit and change nothing or command failed' '
373
377
git replace -d "$PARA3" &&
374
378
test_must_fail env GIT_EDITOR=true git replace --edit "$PARA3" &&
375
- test_must_fail env GIT_EDITOR="./fakeeditor;false " git replace --edit "$PARA3" &&
379
+ test_must_fail env GIT_EDITOR="./failingfakeeditor " git replace --edit "$PARA3" &&
376
380
GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
377
381
git replace -l | grep "$PARA3" &&
378
382
git cat-file commit "$PARA3" | grep "A fake Thor"
You can’t perform that action at this time.
0 commit comments