t7502: tighten loosely written test sequence
We would like to catch breakage at any step in the sequence. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 3, 2008 at 18:10 UTC
a3c91e088ead7c47f43efe8da625d190dcef1001
1 file changed
+18
-17
t/t7502-commit.sh
+18
-17
@@ -196,23 +196,24 @@ chmod +x .git/FAKE_EDITOR
196
197
test_expect_success 'do not fire editor in the presence of conflicts' '
198
199
- git clean
200
- echo f>g
201
- git add g
202
- git commit -myes
203
- git branch second
204
- echo master>g
205
- echo g>h
206
- git add g h
207
- git commit -mmaster
208
- git checkout second
209
- echo second>g
210
- git add g
211
- git commit -msecond
212
- git cherry-pick -n master
213
- echo "editor not started" > .git/result
214
- GIT_EDITOR=`pwd`/.git/FAKE_EDITOR git commit && exit 1 # should fail
215
- test "`cat .git/result`" = "editor not started"
199
+ git clean -f &&
200
+ echo f >g &&
201
+ git add g &&
202
+ git commit -m "add g" &&
203
+ git branch second &&
204
+ echo master >g &&
205
+ echo g >h &&
206
+ git add g h &&
207
+ git commit -m "modify g and add h" &&
208
+ git checkout second &&
209
+ echo second >g &&
210
+ git add g &&
211
+ git commit -m second &&
212
+ # Must fail due to conflict
213
+ test_must_fail git cherry-pick -n master &&
214
+ echo "editor not started" >.git/result &&
215
+ test_must_fail GIT_EDITOR="$(pwd)/.git/FAKE_EDITOR" git commit &&
216
+ test "$(cat .git/result)" = "editor not started"
217
'
218
219
pwd=`pwd`