@@ -79,8 +79,10 @@ test_expect_success 'rebase -i --onto main...topic' '
79
79
git reset --hard &&
80
80
git checkout topic &&
81
81
git reset --hard G &&
82
- set_fake_editor &&
83
- EXPECT_COUNT=1 git rebase -i --onto main...topic F &&
82
+ (
83
+ set_fake_editor &&
84
+ EXPECT_COUNT=1 git rebase -i --onto main...topic F
85
+ ) &&
84
86
git rev-parse HEAD^1 >actual &&
85
87
git rev-parse C^0 >expect &&
86
88
test_cmp expect actual
@@ -90,8 +92,10 @@ test_expect_success 'rebase -i --onto main...' '
90
92
git reset --hard &&
91
93
git checkout topic &&
92
94
git reset --hard G &&
93
- set_fake_editor &&
94
- EXPECT_COUNT=1 git rebase -i --onto main... F &&
95
+ (
96
+ set_fake_editor &&
97
+ EXPECT_COUNT=1 git rebase -i --onto main... F
98
+ ) &&
95
99
git rev-parse HEAD^1 >actual &&
96
100
git rev-parse C^0 >expect &&
97
101
test_cmp expect actual
@@ -102,7 +106,6 @@ test_expect_success 'rebase --onto main...side requires a single merge-base' '
102
106
git checkout side &&
103
107
git reset --hard K &&
104
108
105
- set_fake_editor &&
106
109
test_must_fail git rebase -i --onto main...side J 2>err &&
107
110
grep "need exactly one merge base" err
108
111
'
@@ -157,8 +160,10 @@ test_expect_success 'rebase -i --keep-base main from topic' '
157
160
git checkout topic &&
158
161
git reset --hard G &&
159
162
160
- set_fake_editor &&
161
- EXPECT_COUNT=2 git rebase -i --keep-base main &&
163
+ (
164
+ set_fake_editor &&
165
+ EXPECT_COUNT=2 git rebase -i --keep-base main
166
+ ) &&
162
167
git rev-parse C >base.expect &&
163
168
git merge-base main HEAD >base.actual &&
164
169
test_cmp base.expect base.actual &&
@@ -172,8 +177,10 @@ test_expect_success 'rebase -i --keep-base main topic from main' '
172
177
git checkout main &&
173
178
git branch -f topic G &&
174
179
175
- set_fake_editor &&
176
- EXPECT_COUNT=2 git rebase -i --keep-base main topic &&
180
+ (
181
+ set_fake_editor &&
182
+ EXPECT_COUNT=2 git rebase -i --keep-base main topic
183
+ ) &&
177
184
git rev-parse C >base.expect &&
178
185
git merge-base main HEAD >base.actual &&
179
186
test_cmp base.expect base.actual &&
@@ -188,9 +195,13 @@ test_expect_success 'rebase --keep-base requires a single merge base' '
188
195
git checkout side &&
189
196
git reset --hard K &&
190
197
191
- set_fake_editor &&
192
198
test_must_fail git rebase -i --keep-base main 2>err &&
193
199
grep "need exactly one merge base with branch" err
194
200
'
195
201
202
+ # This must be the last test in this file
203
+ test_expect_success ' $EDITOR and friends are unchanged' '
204
+ test_editor_unchanged
205
+ '
206
+
196
207
test_done
0 commit comments