@@ -102,12 +102,8 @@ test_expect_success 'rebase -i with the exec command runs from tree root' '
102102
103103test_expect_success ' rebase -i with the exec command checks tree cleanness' '
104104 git checkout master &&
105- (
106105 set_fake_editor &&
107- FAKE_LINES="exec_echo_foo_>file1 1" &&
108- export FAKE_LINES &&
109- test_must_fail git rebase -i HEAD^
110- ) &&
106+ test_must_fail env FAKE_LINES="exec_echo_foo_>file1 1" git rebase -i HEAD^ &&
111107 test_cmp_rev master^ HEAD &&
112108 git reset --hard &&
113109 git rebase --continue
@@ -116,12 +112,9 @@ test_expect_success 'rebase -i with the exec command checks tree cleanness' '
116112test_expect_success ' rebase -i with exec of inexistent command' '
117113 git checkout master &&
118114 test_when_finished "git rebase --abort" &&
119- (
120115 set_fake_editor &&
121- FAKE_LINES="exec_this-command-does-not-exist 1" &&
122- export FAKE_LINES &&
123- test_must_fail git rebase -i HEAD^ >actual 2>&1
124- ) &&
116+ test_must_fail env FAKE_LINES="exec_this-command-does-not-exist 1" \
117+ git rebase -i HEAD^ >actual 2>&1 &&
125118 ! grep "Maybe git-rebase is broken" actual
126119'
127120
@@ -375,11 +368,7 @@ test_expect_success 'commit message used after conflict' '
375368 git checkout -b conflict-fixup conflict-branch &&
376369 base=$(git rev-parse HEAD~4) &&
377370 set_fake_editor &&
378- (
379- FAKE_LINES="1 fixup 3 fixup 4" &&
380- export FAKE_LINES &&
381- test_must_fail git rebase -i $base
382- ) &&
371+ test_must_fail env FAKE_LINES="1 fixup 3 fixup 4" git rebase -i $base &&
383372 echo three > conflict &&
384373 git add conflict &&
385374 FAKE_COMMIT_AMEND="ONCE" EXPECT_HEADER_COUNT=2 \
@@ -394,11 +383,7 @@ test_expect_success 'commit message retained after conflict' '
394383 git checkout -b conflict-squash conflict-branch &&
395384 base=$(git rev-parse HEAD~4) &&
396385 set_fake_editor &&
397- (
398- FAKE_LINES="1 fixup 3 squash 4" &&
399- export FAKE_LINES &&
400- test_must_fail git rebase -i $base
401- ) &&
386+ test_must_fail env FAKE_LINES="1 fixup 3 squash 4" git rebase -i $base &&
402387 echo three > conflict &&
403388 git add conflict &&
404389 FAKE_COMMIT_AMEND="TWICE" EXPECT_HEADER_COUNT=2 \
@@ -469,11 +454,7 @@ test_expect_success 'interrupted squash works as expected' '
469454 git checkout -b interrupted-squash conflict-branch &&
470455 one=$(git rev-parse HEAD~3) &&
471456 set_fake_editor &&
472- (
473- FAKE_LINES="1 squash 3 2" &&
474- export FAKE_LINES &&
475- test_must_fail git rebase -i HEAD~3
476- ) &&
457+ test_must_fail env FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 &&
477458 (echo one; echo two; echo four) > conflict &&
478459 git add conflict &&
479460 test_must_fail git rebase --continue &&
@@ -487,11 +468,7 @@ test_expect_success 'interrupted squash works as expected (case 2)' '
487468 git checkout -b interrupted-squash2 conflict-branch &&
488469 one=$(git rev-parse HEAD~3) &&
489470 set_fake_editor &&
490- (
491- FAKE_LINES="3 squash 1 2" &&
492- export FAKE_LINES &&
493- test_must_fail git rebase -i HEAD~3
494- ) &&
471+ test_must_fail env FAKE_LINES="3 squash 1 2" git rebase -i HEAD~3 &&
495472 (echo one; echo four) > conflict &&
496473 git add conflict &&
497474 test_must_fail git rebase --continue &&
@@ -528,11 +505,7 @@ test_expect_success 'aborted --continue does not squash commits after "edit"' '
528505 FAKE_LINES="edit 1" git rebase -i HEAD^ &&
529506 echo "edited again" > file7 &&
530507 git add file7 &&
531- (
532- FAKE_COMMIT_MESSAGE=" " &&
533- export FAKE_COMMIT_MESSAGE &&
534- test_must_fail git rebase --continue
535- ) &&
508+ test_must_fail env FAKE_COMMIT_MESSAGE=" " git rebase --continue &&
536509 test $old = $(git rev-parse HEAD) &&
537510 git rebase --abort
538511'
@@ -547,23 +520,15 @@ test_expect_success 'auto-amend only edited commits after "edit"' '
547520 echo "and again" > file7 &&
548521 git add file7 &&
549522 test_tick &&
550- (
551- FAKE_COMMIT_MESSAGE="and again" &&
552- export FAKE_COMMIT_MESSAGE &&
553- test_must_fail git rebase --continue
554- ) &&
523+ test_must_fail env FAKE_COMMIT_MESSAGE="and again" git rebase --continue &&
555524 git rebase --abort
556525'
557526
558527test_expect_success ' clean error after failed "exec"' '
559528 test_tick &&
560529 test_when_finished "git rebase --abort || :" &&
561530 set_fake_editor &&
562- (
563- FAKE_LINES="1 exec_false" &&
564- export FAKE_LINES &&
565- test_must_fail git rebase -i HEAD^
566- ) &&
531+ test_must_fail env FAKE_LINES="1 exec_false" git rebase -i HEAD^ &&
567532 echo "edited again" > file7 &&
568533 git add file7 &&
569534 test_must_fail git rebase --continue 2>error &&
@@ -947,12 +912,8 @@ test_expect_success 'rebase -i --root retain root commit author and message' '
947912
948913test_expect_success ' rebase -i --root temporary sentinel commit' '
949914 git checkout B &&
950- (
951- set_fake_editor &&
952- FAKE_LINES="2" &&
953- export FAKE_LINES &&
954- test_must_fail git rebase -i --root
955- ) &&
915+ set_fake_editor &&
916+ test_must_fail env FAKE_LINES="2" git rebase -i --root &&
956917 git cat-file commit HEAD | grep "^tree 4b825dc642cb" &&
957918 git rebase --abort
958919'
@@ -1042,11 +1003,7 @@ test_expect_success 'rebase -i error on commits with \ in message' '
10421003 test_when_finished "git rebase --abort; git reset --hard $current_head; rm -f error" &&
10431004 test_commit TO-REMOVE will-conflict old-content &&
10441005 test_commit "\temp" will-conflict new-content dummy &&
1045- (
1046- EDITOR=true &&
1047- export EDITOR &&
1048- test_must_fail git rebase -i HEAD^ --onto HEAD^^ 2>error
1049- ) &&
1006+ test_must_fail env EDITOR=true git rebase -i HEAD^ --onto HEAD^^ 2>error &&
10501007 test_expect_code 1 grep " emp" error
10511008'
10521009
0 commit comments