@@ -181,38 +181,42 @@ test_expect_success "Sergey Vlasov's test case" '
181
181
git mv ab a
182
182
'
183
183
184
- test_expect_success ' absolute pathname' ' (
185
- rm -fr mine &&
186
- mkdir mine &&
187
- cd mine &&
188
- test_create_repo one &&
189
- cd one &&
190
- mkdir sub &&
191
- >sub/file &&
192
- git add sub/file &&
193
-
194
- git mv sub "$(pwd)/in" &&
195
- ! test -d sub &&
196
- test -d in &&
197
- git ls-files --error-unmatch in/file
198
- )'
199
-
200
- test_expect_success ' absolute pathname outside should fail' ' (
201
- rm -fr mine &&
202
- mkdir mine &&
203
- cd mine &&
204
- out=$(pwd) &&
205
- test_create_repo one &&
206
- cd one &&
207
- mkdir sub &&
208
- >sub/file &&
209
- git add sub/file &&
210
-
211
- test_must_fail git mv sub "$out/out" &&
212
- test -d sub &&
213
- ! test -d ../in &&
214
- git ls-files --error-unmatch sub/file
215
- )'
184
+ test_expect_success ' absolute pathname' '
185
+ (
186
+ rm -fr mine &&
187
+ mkdir mine &&
188
+ cd mine &&
189
+ test_create_repo one &&
190
+ cd one &&
191
+ mkdir sub &&
192
+ >sub/file &&
193
+ git add sub/file &&
194
+
195
+ git mv sub "$(pwd)/in" &&
196
+ ! test -d sub &&
197
+ test -d in &&
198
+ git ls-files --error-unmatch in/file
199
+ )
200
+ '
201
+
202
+ test_expect_success ' absolute pathname outside should fail' '
203
+ (
204
+ rm -fr mine &&
205
+ mkdir mine &&
206
+ cd mine &&
207
+ out=$(pwd) &&
208
+ test_create_repo one &&
209
+ cd one &&
210
+ mkdir sub &&
211
+ >sub/file &&
212
+ git add sub/file &&
213
+
214
+ test_must_fail git mv sub "$out/out" &&
215
+ test -d sub &&
216
+ ! test -d ../in &&
217
+ git ls-files --error-unmatch sub/file
218
+ )
219
+ '
216
220
217
221
test_expect_success ' git mv to move multiple sources into a directory' '
218
222
rm -fr .git && git init &&
@@ -503,14 +507,16 @@ test_expect_success 'moving a submodule in nested directories' '
503
507
test_expect_success ' moving nested submodules' '
504
508
git commit -am "cleanup commit" &&
505
509
mkdir sub_nested_nested &&
506
- (cd sub_nested_nested &&
510
+ (
511
+ cd sub_nested_nested &&
507
512
touch nested_level2 &&
508
513
git init &&
509
514
git add . &&
510
515
git commit -m "nested level 2"
511
516
) &&
512
517
mkdir sub_nested &&
513
- (cd sub_nested &&
518
+ (
519
+ cd sub_nested &&
514
520
touch nested_level1 &&
515
521
git init &&
516
522
git add . &&
0 commit comments