t3412: clean up GIT_EDITOR usage
a6c7a27 (rebase -i: correctly remember --root flag across --continue, 2009-01-26) introduced a more portable GIT_EDITOR usage, but left the old tests unchanged. Since we never use the editor (all tests run the rebase script as proposed by rebase -i), just disable it outright, which simplifies the tests. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Jan 30, 2009 at 23:47 UTC
218289644023e40026150422afef93d7eae45d5c
1 file changed
+13
-25
t/t3412-rebase-root.sh
+13
-25
@@ -6,6 +6,10 @@ Tests if git rebase --root --onto <newparent> can rebase the root commit.
6
'
7
. ./test-lib.sh
8
9
+# we always run the interactive rebases unchanged, so just disable the editor
10
+GIT_EDITOR=:
11
+export GIT_EDITOR
12
+
13
test_expect_success 'prepare repository' '
14
test_commit 1 A &&
15
test_commit 2 A &&
@@ -59,7 +63,7 @@ test_expect_success 'pre-rebase got correct input (2)' '
63
64
test_expect_success 'rebase -i --root --onto <newbase>' '
65
git checkout -b work3 other &&
62
- GIT_EDITOR=: git rebase -i --root --onto master &&
66
+ git rebase -i --root --onto master &&
67
git log --pretty=tformat:"%s" > rebased3 &&
68
test_cmp expect rebased3
69
'
@@ -70,7 +74,7 @@ test_expect_success 'pre-rebase got correct input (3)' '
74
75
test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
76
git branch work4 other &&
73
- GIT_EDITOR=: git rebase -i --root --onto master work4 &&
77
+ git rebase -i --root --onto master work4 &&
78
git log --pretty=tformat:"%s" > rebased4 &&
79
test_cmp expect rebased4
80
'
@@ -81,7 +85,7 @@ test_expect_success 'pre-rebase got correct input (4)' '
85
86
test_expect_success 'rebase -i -p with linear history' '
87
git checkout -b work5 other &&
84
- GIT_EDITOR=: git rebase -i -p --root --onto master &&
88
+ git rebase -i -p --root --onto master &&
89
git log --pretty=tformat:"%s" > rebased5 &&
90
test_cmp expect rebased5
91
'
@@ -111,7 +115,7 @@ EOF
115
116
test_expect_success 'rebase -i -p with merge' '
117
git checkout -b work6 other &&
114
- GIT_EDITOR=: git rebase -i -p --root --onto master &&
118
+ git rebase -i -p --root --onto master &&
119
git log --graph --topo-order --pretty=tformat:"%s" > rebased6 &&
120
test_cmp expect-side rebased6
121
'
@@ -142,7 +146,7 @@ EOF
146
147
test_expect_success 'rebase -i -p with two roots' '
148
git checkout -b work7 other &&
145
- GIT_EDITOR=: git rebase -i -p --root --onto master &&
149
+ git rebase -i -p --root --onto master &&
150
git log --graph --topo-order --pretty=tformat:"%s" > rebased7 &&
151
test_cmp expect-third rebased7
152
'
@@ -158,22 +162,14 @@ EOF
162
163
test_expect_success 'pre-rebase hook stops rebase' '
164
git checkout -b stops1 other &&
161
- (
162
- GIT_EDITOR=:
163
- export GIT_EDITOR
164
- test_must_fail git rebase --root --onto master
165
- ) &&
165
+ test_must_fail git rebase --root --onto master &&
166
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1
167
test 0 = $(git rev-list other...stops1 | wc -l)
168
'
169
170
test_expect_success 'pre-rebase hook stops rebase -i' '
171
git checkout -b stops2 other &&
172
- (
173
- GIT_EDITOR=:
174
- export GIT_EDITOR
175
- test_must_fail git rebase --root --onto master
176
- ) &&
172
+ test_must_fail git rebase --root --onto master &&
173
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2
174
test 0 = $(git rev-list other...stops2 | wc -l)
175
'
@@ -218,11 +214,7 @@ test_expect_success 'rebase --root with conflict (second part)' '
214
215
test_expect_success 'rebase -i --root with conflict (first part)' '
216
git checkout -b conflict2 other &&
221
- (
222
- GIT_EDITOR=:
223
- export GIT_EDITOR
224
- test_must_fail git rebase -i --root --onto master
225
- ) &&
217
+ test_must_fail git rebase -i --root --onto master &&
218
git ls-files -u | grep "B$"
219
'
220
@@ -260,11 +252,7 @@ EOF
252
253
test_expect_success 'rebase -i -p --root with conflict (first part)' '
254
git checkout -b conflict3 other &&
263
- (
264
- GIT_EDITOR=:
265
- export GIT_EDITOR
266
- test_must_fail git rebase -i -p --root --onto master
267
- ) &&
255
+ test_must_fail git rebase -i -p --root --onto master &&
256
git ls-files -u | grep "B$"
257
'
258