@@ -33,7 +33,6 @@ fill () {
33
33
34
34
35
35
test_expect_success setup '
36
-
37
36
fill x y z > same &&
38
37
fill 1 2 3 4 5 6 7 8 >one &&
39
38
fill a b c d e >two &&
@@ -63,7 +62,6 @@ test_expect_success setup '
63
62
'
64
63
65
64
test_expect_success ' checkout from non-existing branch' '
66
-
67
65
git checkout -b delete-me master &&
68
66
git update-ref -d --no-deref refs/heads/delete-me &&
69
67
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
@@ -72,7 +70,6 @@ test_expect_success 'checkout from non-existing branch' '
72
70
'
73
71
74
72
test_expect_success ' checkout with dirty tree without -m' '
75
-
76
73
fill 0 1 2 3 4 5 6 7 8 >one &&
77
74
if git checkout side
78
75
then
@@ -81,11 +78,9 @@ test_expect_success 'checkout with dirty tree without -m' '
81
78
else
82
79
echo "happy - failed correctly"
83
80
fi
84
-
85
81
'
86
82
87
83
test_expect_success ' checkout with unrelated dirty tree without -m' '
88
-
89
84
git checkout -f master &&
90
85
fill 0 1 2 3 4 5 6 7 8 >same &&
91
86
cp same kept &&
@@ -96,7 +91,6 @@ test_expect_success 'checkout with unrelated dirty tree without -m' '
96
91
'
97
92
98
93
test_expect_success ' checkout -m with dirty tree' '
99
-
100
94
git checkout -f master &&
101
95
git clean -f &&
102
96
@@ -121,7 +115,6 @@ test_expect_success 'checkout -m with dirty tree' '
121
115
'
122
116
123
117
test_expect_success ' checkout -m with dirty tree, renamed' '
124
-
125
118
git checkout -f master && git clean -f &&
126
119
127
120
fill 1 2 3 4 5 7 8 >one &&
@@ -139,11 +132,9 @@ test_expect_success 'checkout -m with dirty tree, renamed' '
139
132
! test -f one &&
140
133
git diff --cached >current &&
141
134
test_must_be_empty current
142
-
143
135
'
144
136
145
137
test_expect_success ' checkout -m with merge conflict' '
146
-
147
138
git checkout -f master && git clean -f &&
148
139
149
140
fill 1 T 3 4 5 6 S 8 >one &&
@@ -166,7 +157,6 @@ test_expect_success 'checkout -m with merge conflict' '
166
157
'
167
158
168
159
test_expect_success ' format of merge conflict from checkout -m' '
169
-
170
160
git checkout -f master && git clean -f &&
171
161
172
162
fill b d > two &&
@@ -190,7 +180,6 @@ test_expect_success 'format of merge conflict from checkout -m' '
190
180
'
191
181
192
182
test_expect_success ' checkout --merge --conflict=diff3 <branch>' '
193
-
194
183
git checkout -f master && git reset --hard && git clean -f &&
195
184
196
185
fill b d > two &&
@@ -216,7 +205,6 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
216
205
'
217
206
218
207
test_expect_success ' switch to another branch while carrying a deletion' '
219
-
220
208
git checkout -f master && git reset --hard && git clean -f &&
221
209
git rm two &&
222
210
@@ -228,7 +216,6 @@ test_expect_success 'switch to another branch while carrying a deletion' '
228
216
'
229
217
230
218
test_expect_success ' checkout to detach HEAD (with advice declined)' '
231
-
232
219
git config advice.detachedHead false &&
233
220
rev=$(git rev-parse --short renamer^) &&
234
221
git checkout -f renamer && git clean -f &&
@@ -267,7 +254,6 @@ test_expect_success 'checkout to detach HEAD' '
267
254
'
268
255
269
256
test_expect_success ' checkout to detach HEAD with branchname^' '
270
-
271
257
git checkout -f master && git clean -f &&
272
258
git checkout renamer^ &&
273
259
H=$(git rev-parse --verify HEAD) &&
@@ -283,7 +269,6 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
283
269
'
284
270
285
271
test_expect_success ' checkout to detach HEAD with :/message' '
286
-
287
272
git checkout -f master && git clean -f &&
288
273
git checkout ":/Initial" &&
289
274
H=$(git rev-parse --verify HEAD) &&
@@ -299,7 +284,6 @@ test_expect_success 'checkout to detach HEAD with :/message' '
299
284
'
300
285
301
286
test_expect_success ' checkout to detach HEAD with HEAD^0' '
302
-
303
287
git checkout -f master && git clean -f &&
304
288
git checkout HEAD^0 &&
305
289
H=$(git rev-parse --verify HEAD) &&
@@ -315,7 +299,6 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
315
299
'
316
300
317
301
test_expect_success ' checkout with ambiguous tag/branch names' '
318
-
319
302
git tag both side &&
320
303
git branch both master &&
321
304
git reset --hard &&
@@ -327,11 +310,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
327
310
test "z$H" = "z$M" &&
328
311
name=$(git symbolic-ref HEAD 2>/dev/null) &&
329
312
test "z$name" = zrefs/heads/both
330
-
331
313
'
332
314
333
315
test_expect_success ' checkout with ambiguous tag/branch names' '
334
-
335
316
git reset --hard &&
336
317
git checkout master &&
337
318
@@ -351,11 +332,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
351
332
else
352
333
: happy
353
334
fi
354
-
355
335
'
356
336
357
337
test_expect_success ' switch branches while in subdirectory' '
358
-
359
338
git reset --hard &&
360
339
git checkout master &&
361
340
@@ -366,11 +345,9 @@ test_expect_success 'switch branches while in subdirectory' '
366
345
) &&
367
346
! test -f subs/one &&
368
347
rm -fr subs
369
-
370
348
'
371
349
372
350
test_expect_success ' checkout specific path while in subdirectory' '
373
-
374
351
git reset --hard &&
375
352
git checkout side &&
376
353
mkdir subs &&
@@ -385,7 +362,6 @@ test_expect_success 'checkout specific path while in subdirectory' '
385
362
git checkout side -- bero
386
363
) &&
387
364
test -f subs/bero
388
-
389
365
'
390
366
391
367
test_expect_success ' checkout w/--track sets up tracking' '
@@ -608,7 +584,6 @@ test_expect_success 'failing checkout -b should not break working tree' '
608
584
test $(git symbolic-ref HEAD) = refs/heads/master &&
609
585
git diff --exit-code &&
610
586
git diff --cached --exit-code
611
-
612
587
'
613
588
614
589
test_expect_success ' switch out of non-branch' '
0 commit comments