'
test_expect_success 'moving the file out of subdirectory' '
- cd path0 && git mv COPYING ../path1/COPYING
+ git -C path0 mv COPYING ../path1/COPYING
'
# in path0 currently
test_expect_success 'commiting the change' '
- cd .. && git commit -m move-out -a
+ git commit -m move-out -a
'
test_expect_success 'checking the commit' '
'
test_expect_success 'moving the file back into subdirectory' '
- cd path0 && git mv ../path1/COPYING COPYING
+ git -C path0 mv ../path1/COPYING COPYING
'
# in path0 currently
test_expect_success 'commiting the change' '
- cd .. && git commit -m move-in -a
+ git commit -m move-in -a
'
test_expect_success 'checking the commit' '
git mv sub mod/sub &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
'
git mv sub mod/sub &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
echo mod/sub >expected &&
git config -f .gitmodules submodule.sub.path >actual &&
test_cmp expected actual &&
git submodule update &&
entry="$(git ls-files --stage sub | cut -f 1)" &&
mkdir mod &&
- (
- cd mod &&
- git mv ../sub/ .
- ) &&
+ git -C mod mv ../sub/ . &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
echo mod/sub >expected &&
git config -f .gitmodules submodule.sub.path >actual &&
test_cmp expected actual &&
test_must_be_empty actual.err &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
'
test_must_be_empty actual.err &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
'
test_i18ncmp expect.err actual.err &&
! test -e sub &&
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
- (
- cd mod/sub &&
- git status
- ) &&
+ git -C mod/sub status &&
git update-index --refresh &&
git diff-files --quiet
'