Skip to content

Commit

Permalink
Update t7001-mv.sh
Browse files Browse the repository at this point in the history
Adding idiomatic expressions for intenally negated (sub) commands
  • Loading branch information
fobiasic07 committed Oct 26, 2022
1 parent 034c75d commit 9d305c2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions t/t7001-mv.sh
Expand Up @@ -215,7 +215,7 @@ test_expect_success 'absolute pathname' '
git add sub/file &&
git mv sub "$(pwd)/in" &&
test_path_is_dir sub &&
! test_path_is_dir sub &&
test_path_is_dir in &&
git ls-files --error-unmatch in/file
)
Expand All @@ -235,7 +235,7 @@ test_expect_success 'absolute pathname outside should fail' '
test_must_fail git mv sub "$out/out" &&
test_path_is_dir sub &&
test_path_is_dir ../in &&
! test_path_is_dir ../in &&
git ls-files --error-unmatch sub/file
)
'
Expand Down Expand Up @@ -295,7 +295,7 @@ test_expect_success 'git mv should overwrite symlink to a file' '
git add moved &&
test_must_fail git mv moved symlink &&
git mv -f moved symlink &&
test_path_exists moved &&
! test_path_exists moved &&
test_path_is_file symlink &&
test "$(cat symlink)" = 1 &&
git update-index --refresh &&
Expand All @@ -312,7 +312,7 @@ test_expect_success 'git mv should overwrite file with a symlink' '
git add moved &&
test_must_fail git mv symlink moved &&
git mv -f symlink moved &&
test_path_exists symlink &&
! test_path_exists symlink &&
git update-index --refresh &&
git diff-files --quiet
'
Expand Down Expand Up @@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
) &&
mkdir mod &&
git mv sub mod/sub &&
test_path_exists sub &&
! test_path_exists sub &&
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
git -C mod/sub status &&
git update-index --refresh &&
Expand All @@ -372,7 +372,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
) &&
mkdir mod &&
git mv sub mod/sub &&
test_path_exists sub &&
! test_path_exists sub &&
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
git -C mod/sub status &&
echo mod/sub >expected &&
Expand All @@ -389,7 +389,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '
entry="$(git ls-files --stage sub | cut -f 1)" &&
mkdir mod &&
git -C mod mv ../sub/ . &&
test_path_exists sub &&
! test_path_exists sub &&
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
git -C mod/sub status &&
echo mod/sub >expected &&
Expand All @@ -408,7 +408,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '
mkdir mod &&
git mv sub mod/sub 2>actual.err &&
test_must_be_empty actual.err &&
test_path_exists sub &&
! test_path_exists sub &&
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
git -C mod/sub status &&
git update-index --refresh &&
Expand Down Expand Up @@ -447,7 +447,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
mkdir mod &&
git mv sub mod/sub 2>actual.err &&
test_cmp expect.err actual.err &&
test_path_exists sub &&
! test_path_exists sub &&
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
git -C mod/sub status &&
git update-index --refresh &&
Expand All @@ -474,7 +474,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
git status -s sub2 >actual &&
echo "?? sub2/" >expected &&
test_cmp expected actual &&
test_path_is_file sub/.git &&
! test_path_is_file sub/.git &&
test_path_is_file sub2/.git &&
git submodule update &&
test_path_is_file sub/.git &&
Expand Down

0 comments on commit 9d305c2

Please sign in to comment.