@@ -11,12 +11,12 @@ test_expect_success 'prepare reference tree' '
11
11
'
12
12
13
13
test_expect_success ' moving the file out of subdirectory' '
14
- cd path0 && git mv COPYING ../path1/COPYING
14
+ git -C path0 mv COPYING ../path1/COPYING
15
15
'
16
16
17
17
# in path0 currently
18
18
test_expect_success ' commiting the change' '
19
- cd .. && git commit -m move-out -a
19
+ git commit -m move-out -a
20
20
'
21
21
22
22
test_expect_success ' checking the commit' '
@@ -25,12 +25,12 @@ test_expect_success 'checking the commit' '
25
25
'
26
26
27
27
test_expect_success ' moving the file back into subdirectory' '
28
- cd path0 && git mv ../path1/COPYING COPYING
28
+ git -C path0 mv ../path1/COPYING COPYING
29
29
'
30
30
31
31
# in path0 currently
32
32
test_expect_success ' commiting the change' '
33
- cd .. && git commit -m move-in -a
33
+ git commit -m move-in -a
34
34
'
35
35
36
36
test_expect_success ' checking the commit' '
@@ -328,10 +328,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
328
328
git mv sub mod/sub &&
329
329
! test -e sub &&
330
330
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
331
- (
332
- cd mod/sub &&
333
- git status
334
- ) &&
331
+ git -C mod/sub status &&
335
332
git update-index --refresh &&
336
333
git diff-files --quiet
337
334
'
@@ -351,10 +348,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
351
348
git mv sub mod/sub &&
352
349
! test -e sub &&
353
350
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
354
- (
355
- cd mod/sub &&
356
- git status
357
- ) &&
351
+ git -C mod/sub status &&
358
352
echo mod/sub >expected &&
359
353
git config -f .gitmodules submodule.sub.path >actual &&
360
354
test_cmp expected actual &&
@@ -368,16 +362,10 @@ test_expect_success 'git mv moves a submodule with gitfile' '
368
362
git submodule update &&
369
363
entry="$(git ls-files --stage sub | cut -f 1)" &&
370
364
mkdir mod &&
371
- (
372
- cd mod &&
373
- git mv ../sub/ .
374
- ) &&
365
+ git -C mod mv ../sub/ . &&
375
366
! test -e sub &&
376
367
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
377
- (
378
- cd mod/sub &&
379
- git status
380
- ) &&
368
+ git -C mod/sub status &&
381
369
echo mod/sub >expected &&
382
370
git config -f .gitmodules submodule.sub.path >actual &&
383
371
test_cmp expected actual &&
@@ -396,10 +384,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '
396
384
test_must_be_empty actual.err &&
397
385
! test -e sub &&
398
386
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
399
- (
400
- cd mod/sub &&
401
- git status
402
- ) &&
387
+ git -C mod/sub status &&
403
388
git update-index --refresh &&
404
389
git diff-files --quiet
405
390
'
@@ -420,10 +405,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
420
405
test_must_be_empty actual.err &&
421
406
! test -e sub &&
422
407
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
423
- (
424
- cd mod/sub &&
425
- git status
426
- ) &&
408
+ git -C mod/sub status &&
427
409
git update-index --refresh &&
428
410
git diff-files --quiet
429
411
'
@@ -441,10 +423,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
441
423
test_i18ncmp expect.err actual.err &&
442
424
! test -e sub &&
443
425
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
444
- (
445
- cd mod/sub &&
446
- git status
447
- ) &&
426
+ git -C mod/sub status &&
448
427
git update-index --refresh &&
449
428
git diff-files --quiet
450
429
'
0 commit comments