Skip to content

Commit 1576f78

Browse files
committed
Merge branch 'sg/t6050-failing-editor-test-fix'
* sg/t6050-failing-editor-test-fix: t6050-replace: make failing editor test more robust
2 parents 108cb77 + 36fc7d8 commit 1576f78

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/t6050-replace.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,15 @@ test_expect_success 'test --format long' '
351351
test_cmp expected actual
352352
'
353353

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 &&
356356
sed -e "s/A U Thor/A fake Thor/" "$1" >"$1.new"
357357
mv "$1.new" "$1"
358358
EOF
359+
write_script failingfakeeditor <<-\EOF
360+
./fakeeditor "$@"
361+
false
362+
EOF
359363
'
360364

361365
test_expect_success '--edit with and without already replaced object' '
@@ -372,7 +376,7 @@ test_expect_success '--edit with and without already replaced object' '
372376
test_expect_success '--edit and change nothing or command failed' '
373377
git replace -d "$PARA3" &&
374378
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" &&
376380
GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
377381
git replace -l | grep "$PARA3" &&
378382
git cat-file commit "$PARA3" | grep "A fake Thor"

0 commit comments

Comments
 (0)