{"thread":{"id":"58719","subject":"[PATCH] t7001-mv.sh:modernizing test script using function","startedAt":"2022-10-30T17:20:48Z","lastAt":"2022-11-04T22:01:01Z","messageCount":8,"participants":["Debra Obondo via GitGitGadget","Taylor Blau","Martin Ågren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"466059","messageId":"pull.1372.git.git.1667150441883.gitgitgadget@gmail.com","threadId":"58719","inReplyTo":null,"subject":"[PATCH] t7001-mv.sh:modernizing test script using function","fromName":"Debra Obondo via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-10-30T17:20:41Z","receivedAt":"2022-10-30T17:20:48Z","isPatch":true,"sender":{"key":"debraobondo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97498997?v=4"},"body":"From: Debra Obondo <debraobondo@gmail.com>\n\nTest script to verify the presence/absence of files, paths, directories,\nsymlinks and other features in 'git mv' command are using the command\nformat:\n\n'test (-e|f|d|h|...)'\n\nReplace them with helper functions of format:\n\n'test_path_is_*'\n\nSigned-off-by: Debra Obondo <debraobondo@gmail.com>\n---\n    [PATCH] [OUTREACHY] t7001-mv.sh : Use test_path_is_* functions in test\n    script\n    \n    Older test scripts use the command 'test -' to verify the presence or\n    absence of features such as files, directories and symbolic links. This\n    however requires slightly complicated uses, such as 'test ! -f '. The\n    helper functions 'test_path_is_' located in t/test-lib-functions.sh have\n    taken into account all scenarios of the 'test -*' to reduce errors. This\n    was a microproject to replace them with the helper functions.\n    \n    Test script to verify the presence/absence of files, paths,\n    directories,symboliclinks and many other features in mv command are\n    using the command format\n    \n    'test -(e|f|s|h|...).\n    \n    Replace them with helper functions of format\n    \n    'test_path_is_*'\n    \n    Signed-off-by: Debra Obondo debraobondo@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1372%2Ffobiasic07%2Ft7001-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1372/fobiasic07/t7001-v1\nPull-Request: https://github.com/git/git/pull/1372\n\n t/t7001-mv.sh | 62 +++++++++++++++++++++++++--------------------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 8c37bceb336..aa97a2f8e1c 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -60,8 +60,8 @@ test_expect_success 'checking the commit' '\n \n test_expect_success 'mv --dry-run does not move file' '\n \tgit mv -n path0/COPYING MOVED &&\n-\ttest -f path0/COPYING &&\n-\ttest ! -f MOVED\n+\ttest_path_is_file path0/COPYING &&\n+\t! test_path_is_file MOVED\n '\n \n test_expect_success 'checking -k on non-existing file' '\n@@ -71,25 +71,25 @@ test_expect_success 'checking -k on non-existing file' '\n test_expect_success 'checking -k on untracked file' '\n \t>untracked1 &&\n \tgit mv -k untracked1 path0 &&\n-\ttest -f untracked1 &&\n-\ttest ! -f path0/untracked1\n+\ttest_path_is_file untracked1 &&\n+\t! test_path_is_file path0/untracked1\n '\n \n test_expect_success 'checking -k on multiple untracked files' '\n \t>untracked2 &&\n \tgit mv -k untracked1 untracked2 path0 &&\n-\ttest -f untracked1 &&\n-\ttest -f untracked2 &&\n-\ttest ! -f path0/untracked1 &&\n-\ttest ! -f path0/untracked2\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file untracked2 &&\n+\t! test_path_is_file path0/untracked1 &&\n+\t! test_path_is_file path0/untracked2\n '\n \n test_expect_success 'checking -f on untracked file with existing target' '\n \t>path0/untracked1 &&\n \ttest_must_fail git mv -f untracked1 path0 &&\n-\ttest ! -f .git/index.lock &&\n-\ttest -f untracked1 &&\n-\ttest -f path0/untracked1\n+\t! test_path_is_file .git/index.lock &&\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file path0/untracked1\n '\n \n # clean up the mess in case bad things happen\n@@ -215,8 +215,8 @@ test_expect_success 'absolute pathname' '\n \t\tgit add sub/file &&\n \n \t\tgit mv sub \"$(pwd)/in\" &&\n-\t\t! test -d sub &&\n-\t\ttest -d in &&\n+\t\t! test_path_is_dir sub &&\n+\t\ttest_path_is_dir in &&\n \t\tgit ls-files --error-unmatch in/file\n \t)\n '\n@@ -234,8 +234,8 @@ test_expect_success 'absolute pathname outside should fail' '\n \t\tgit add sub/file &&\n \n \t\ttest_must_fail git mv sub \"$out/out\" &&\n-\t\ttest -d sub &&\n-\t\t! test -d ../in &&\n+\t\ttest_path_is_dir sub &&\n+\t\t! test_path_is_dir ../in &&\n \t\tgit ls-files --error-unmatch sub/file\n \t)\n '\n@@ -295,8 +295,8 @@ test_expect_success 'git mv should overwrite symlink to a file' '\n \tgit add moved &&\n \ttest_must_fail git mv moved symlink &&\n \tgit mv -f moved symlink &&\n-\t! test -e moved &&\n-\ttest -f symlink &&\n+\t! test_path_exists moved &&\n+\ttest_path_is_file symlink &&\n \ttest \"$(cat symlink)\" = 1 &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n@@ -312,13 +312,13 @@ test_expect_success 'git mv should overwrite file with a symlink' '\n \tgit add moved &&\n \ttest_must_fail git mv symlink moved &&\n \tgit mv -f symlink moved &&\n-\t! test -e symlink &&\n+\t! test_path_exists symlink &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n '\n \n test_expect_success SYMLINKS 'check moved symlink' '\n-\ttest -h moved\n+\ttest_path_is_symlink moved\n '\n \n rm -f moved symlink\n@@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -372,7 +372,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -389,7 +389,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \tgit -C mod mv ../sub/ . &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -408,7 +408,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -423,13 +423,13 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \ttest_must_fail git mv sub mod/sub 2>actual.err &&\n-\ttest -s actual.err &&\n-\ttest -e sub &&\n+\ttest_file_not_empty actual.err &&\n+\ttest_path_exists sub &&\n \tgit diff-files --quiet -- sub &&\n \tgit add .gitmodules &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -447,7 +447,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_cmp expect.err actual.err &&\n-\t! test -e sub &&\n+\t! test_path_exists sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -460,7 +460,7 @@ test_expect_success 'mv --dry-run does not touch the submodule or .gitmodules' '\n \tgit submodule update &&\n \tmkdir mod &&\n \tgit mv -n sub mod/sub 2>actual.err &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet -- sub .gitmodules\n@@ -474,10 +474,10 @@ test_expect_success 'checking out a commit before submodule moved needs manual u\n \tgit status -s sub2 >actual &&\n \techo \"?? sub2/\" >expected &&\n \ttest_cmp expected actual &&\n-\t! test -f sub/.git &&\n-\ttest -f sub2/.git &&\n+\t! test_path_is_file sub/.git &&\n+\ttest_path_is_file sub2/.git &&\n \tgit submodule update &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \trm -rf sub2 &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n\nbase-commit: 1fc3c0ad407008c2f71dd9ae1241d8b75f8ef886\n-- \ngitgitgadget\n"},{"id":"466060","messageId":"Y167rdL0IB5wnXHL@nand.local","threadId":"58719","inReplyTo":"pull.1372.git.git.1667150441883.gitgitgadget@gmail.com","subject":"Re: [PATCH] t7001-mv.sh:modernizing test script using function","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-10-30T18:00:13Z","receivedAt":"2022-10-30T18:00:20Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Sun, Oct 30, 2022 at 05:20:41PM +0000, Debra Obondo via GitGitGadget wrote:\n>  t/t7001-mv.sh | 62 +++++++++++++++++++++++++--------------------------\n>  1 file changed, 31 insertions(+), 31 deletions(-)\n\nLooks good. Will queue, thanks.\n\nThanks,\nTaylor\n"},{"id":"466105","messageId":"CAN0heSpvgtLG5o9i_cSbn0zHfNN+GJFYY6oBXmHUs8FniW5oOw@mail.gmail.com","threadId":"58719","inReplyTo":"pull.1372.git.git.1667150441883.gitgitgadget@gmail.com","subject":"Re: [PATCH] t7001-mv.sh:modernizing test script using function","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2022-10-31T18:04:20Z","receivedAt":"2022-10-31T18:06:02Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"Hi Debra,\n\nOn Sun, 30 Oct 2022 at 18:35, Debra Obondo via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n>\n> From: Debra Obondo <debraobondo@gmail.com>\n>\n> Test script to verify the presence/absence of files, paths, directories,\n> symlinks and other features in 'git mv' command are using the command\n> format:\n>\n> 'test (-e|f|d|h|...)'\n>\n> Replace them with helper functions of format:\n>\n> 'test_path_is_*'\n\nThis is a good idea.\n\nThe subject of this patch could use a space after the colon. You could\nalso write \"modernize\" to give an order to the code base. So something\nlike\n\n  t7001-mv.sh: modernize test script using function\n\nperhaps. \"Function\" is a bit vague, perhaps.\n\nI wanted to comment on this:\n\n>  test_expect_success 'mv --dry-run does not move file' '\n>         git mv -n path0/COPYING MOVED &&\n> -       test -f path0/COPYING &&\n> -       test ! -f MOVED\n> +       test_path_is_file path0/COPYING &&\n> +       ! test_path_is_file MOVED\n>  '\n\nIt is my understanding that we prefer to only use such a helper when we\nreally expect the file to exist. If the path is not a file, this helper\nprints a helpful message before returning with an error.\n\nHere, this means we will emit this 'helpful'\n\n  File MOVED doesn't exist\n\non every test run, when really everything is as it should. And if the\nfile is actually there, i.e., we have a bug, we'll emit nothing -- but\nthat is precisely when we would want some diagnostics such as\n\n  Path exists:\n  ... MOVED ...\n\nto show us that the file actually exists, contrary to the test's\nexpectations.\n\nSuch output is precisely what `test_path_is_missing` would give us. :-)\n\nMy gut feeling is that where this patch adds \"! test_path_foo\", it\nshould use \"test_path_bar\" instead, for various values of \"foo\" and\n\"bar\". What do you think about that?\n\n\nMartin\n"},{"id":"466159","messageId":"Y2By+vbn7dPrk+01@nand.local","threadId":"58719","inReplyTo":"CAN0heSpvgtLG5o9i_cSbn0zHfNN+GJFYY6oBXmHUs8FniW5oOw@mail.gmail.com","subject":"Re: [PATCH] t7001-mv.sh:modernizing test script using function","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-11-01T01:14:34Z","receivedAt":"2022-11-01T01:14:39Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 31, 2022 at 07:04:20PM +0100, Martin Ågren wrote:\n> Hi Debra,\n>\n> On Sun, 30 Oct 2022 at 18:35, Debra Obondo via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n> >\n> > From: Debra Obondo <debraobondo@gmail.com>\n> >\n> > Test script to verify the presence/absence of files, paths, directories,\n> > symlinks and other features in 'git mv' command are using the command\n> > format:\n> >\n> > 'test (-e|f|d|h|...)'\n> >\n> > Replace them with helper functions of format:\n> >\n> > 'test_path_is_*'\n>\n> This is a good idea.\n>\n> The subject of this patch could use a space after the colon. You could\n> also write \"modernize\" to give an order to the code base. So something\n> like\n>\n>   t7001-mv.sh: modernize test script using function\n>\n> perhaps. \"Function\" is a bit vague, perhaps.\n>\n> I wanted to comment on this:\n>\n> >  test_expect_success 'mv --dry-run does not move file' '\n> >         git mv -n path0/COPYING MOVED &&\n> > -       test -f path0/COPYING &&\n> > -       test ! -f MOVED\n> > +       test_path_is_file path0/COPYING &&\n> > +       ! test_path_is_file MOVED\n> >  '\n>\n> It is my understanding that we prefer to only use such a helper when we\n> really expect the file to exist. If the path is not a file, this helper\n> prints a helpful message before returning with an error.\n>\n> Here, this means we will emit this 'helpful'\n>\n>   File MOVED doesn't exist\n>\n> on every test run, when really everything is as it should. And if the\n> file is actually there, i.e., we have a bug, we'll emit nothing -- but\n> that is precisely when we would want some diagnostics such as\n>\n>   Path exists:\n>   ... MOVED ...\n>\n> to show us that the file actually exists, contrary to the test's\n> expectations.\n>\n> Such output is precisely what `test_path_is_missing` would give us. :-)\n>\n> My gut feeling is that where this patch adds \"! test_path_foo\", it\n> should use \"test_path_bar\" instead, for various values of \"foo\" and\n> \"bar\". What do you think about that?\n\nAll good suggestions, thanks. I'll hold this back while we wait for a\nrerolled version.\n\nThanks,\nTaylor\n"},{"id":"466446","messageId":"pull.1372.v2.git.git.1667500788132.gitgitgadget@gmail.com","threadId":"58719","inReplyTo":"pull.1372.git.git.1667150441883.gitgitgadget@gmail.com","subject":"[PATCH v2] t7001-mv.sh: modernizing test script using functions","fromName":"Debra Obondo via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-11-03T18:39:48Z","receivedAt":"2022-11-03T18:39:56Z","isPatch":true,"sender":{"key":"debraobondo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97498997?v=4"},"body":"From: Debra Obondo <debraobondo@gmail.com>\n\nTest script to verify the presence/absence of files, paths, directories,\nsymlinks and other features in 'git mv' command are using the command\nformat:\n\n'test (-e|f|d|h|...)'\n\nReplace them with helper functions of format:\n\n'test_path_is_*'\n\nChanges since v1\n\nReplacing idiomatic helper functions\n\n'! test_path_is_*'\n\nwith\n\n'test_path_is_missing'\n\nThis uses values of 'test_path_bar' in place of '! test_path_foo' to\nbring in the helpful factor of indicating the failure of tests after the\nmv command has been used, that is, it echoes if the feature/test_path\nexists.\n\nSigned-off-by: Debra Obondo <debraobondo@gmail.com>\n---\n    [PATCH v2] [OUTREACHY] t7001-mv.sh : Use test_path_is_* functions in\n    test script\n    \n    Changes since v1:\n    \n    Replacing idiomatic helper functions\n    \n    '! test_path_is_*'\n    \n    with\n    \n    'test_path_is_missing'\n    \n    This uses values of 'test_path_bar' in place of '! test_path_foo' to\n    bring in the helpful factor of indicating the failure of tests after the\n    mv command has been used, that is, it echoes if the feature/test_path\n    exists (This was suggested by Martin Ågren).\n    \n    Older test scripts use the command 'test -' to verify the presence or\n    absence of features such as files, directories and symbolic links. This\n    however requires slightly complicated uses, such as 'test ! -f '. The\n    helper functions 'test_path_is_' located in t/test-lib-functions.sh have\n    taken into account all scenarios of the 'test -*' to reduce errors. This\n    was a microproject to replace them with the helper functions.\n    \n    Test script to verify the presence/absence of files, paths,\n    directories,symboliclinks and many other features in mv command are\n    using the command format\n    \n    'test -(e|f|s|h|...).\n    \n    Replace them with helper functions of format\n    \n    'test_path_is_*'\n    \n    Signed-off-by: Debra Obondo debraobondo@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1372%2Ffobiasic07%2Ft7001-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1372/fobiasic07/t7001-v2\nPull-Request: https://github.com/git/git/pull/1372\n\nRange-diff vs v1:\n\n 1:  b977c4ad26a ! 1:  c6640ebff66 t7001-mv.sh:modernizing test script using function\n     @@ Metadata\n      Author: Debra Obondo <debraobondo@gmail.com>\n      \n       ## Commit message ##\n     -    t7001-mv.sh:modernizing test script using function\n     +    t7001-mv.sh: modernizing test script using functions\n      \n          Test script to verify the presence/absence of files, paths, directories,\n          symlinks and other features in 'git mv' command are using the command\n     @@ Commit message\n      \n          'test_path_is_*'\n      \n     +    Changes since v1\n     +\n     +    Replacing idiomatic helper functions\n     +\n     +    '! test_path_is_*'\n     +\n     +    with\n     +\n     +    'test_path_is_missing'\n     +\n     +    This uses values of 'test_path_bar' in place of '! test_path_foo' to\n     +    bring in the helpful factor of indicating the failure of tests after the\n     +    mv command has been used, that is, it echoes if the feature/test_path\n     +    exists.\n     +\n          Signed-off-by: Debra Obondo <debraobondo@gmail.com>\n      \n       ## t/t7001-mv.sh ##\n     @@ t/t7001-mv.sh: test_expect_success 'checking the commit' '\n      -\ttest -f path0/COPYING &&\n      -\ttest ! -f MOVED\n      +\ttest_path_is_file path0/COPYING &&\n     -+\t! test_path_is_file MOVED\n     ++\ttest_path_is_missing MOVED\n       '\n       \n       test_expect_success 'checking -k on non-existing file' '\n     @@ t/t7001-mv.sh: test_expect_success 'checking -k on non-existing file' '\n      -\ttest -f untracked1 &&\n      -\ttest ! -f path0/untracked1\n      +\ttest_path_is_file untracked1 &&\n     -+\t! test_path_is_file path0/untracked1\n     ++\ttest_path_is_missing path0/untracked1\n       '\n       \n       test_expect_success 'checking -k on multiple untracked files' '\n     @@ t/t7001-mv.sh: test_expect_success 'checking -k on non-existing file' '\n      -\ttest ! -f path0/untracked2\n      +\ttest_path_is_file untracked1 &&\n      +\ttest_path_is_file untracked2 &&\n     -+\t! test_path_is_file path0/untracked1 &&\n     -+\t! test_path_is_file path0/untracked2\n     ++\ttest_path_is_missing path0/untracked1 &&\n     ++\ttest_path_is_missing path0/untracked2\n       '\n       \n       test_expect_success 'checking -f on untracked file with existing target' '\n     @@ t/t7001-mv.sh: test_expect_success 'checking -k on non-existing file' '\n      -\ttest ! -f .git/index.lock &&\n      -\ttest -f untracked1 &&\n      -\ttest -f path0/untracked1\n     -+\t! test_path_is_file .git/index.lock &&\n     ++\ttest_path_is_missing .git/index.lock &&\n      +\ttest_path_is_file untracked1 &&\n      +\ttest_path_is_file path0/untracked1\n       '\n     @@ t/t7001-mv.sh: test_expect_success 'absolute pathname' '\n       \t\tgit mv sub \"$(pwd)/in\" &&\n      -\t\t! test -d sub &&\n      -\t\ttest -d in &&\n     -+\t\t! test_path_is_dir sub &&\n     ++\t\ttest_path_is_missing sub &&\n      +\t\ttest_path_is_dir in &&\n       \t\tgit ls-files --error-unmatch in/file\n       \t)\n     @@ t/t7001-mv.sh: test_expect_success 'absolute pathname outside should fail' '\n      -\t\ttest -d sub &&\n      -\t\t! test -d ../in &&\n      +\t\ttest_path_is_dir sub &&\n     -+\t\t! test_path_is_dir ../in &&\n     ++\t\ttest_path_is_missing ../in &&\n       \t\tgit ls-files --error-unmatch sub/file\n       \t)\n       '\n     @@ t/t7001-mv.sh: test_expect_success 'git mv should overwrite symlink to a file' '\n       \tgit mv -f moved symlink &&\n      -\t! test -e moved &&\n      -\ttest -f symlink &&\n     -+\t! test_path_exists moved &&\n     ++\ttest_path_is_missing moved &&\n      +\ttest_path_is_file symlink &&\n       \ttest \"$(cat symlink)\" = 1 &&\n       \tgit update-index --refresh &&\n     @@ t/t7001-mv.sh: test_expect_success 'git mv should overwrite file with a symlink'\n       \ttest_must_fail git mv symlink moved &&\n       \tgit mv -f symlink moved &&\n      -\t! test -e symlink &&\n     -+\t! test_path_exists symlink &&\n     ++\ttest_path_is_missing symlink &&\n       \tgit update-index --refresh &&\n       \tgit diff-files --quiet\n       '\n     @@ t/t7001-mv.sh: test_expect_success 'git mv moves a submodule with a .git directo\n       \tmkdir mod &&\n       \tgit mv sub mod/sub &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \tgit update-index --refresh &&\n     @@ t/t7001-mv.sh: test_expect_success 'git mv moves a submodule with a .git directo\n       \tmkdir mod &&\n       \tgit mv sub mod/sub &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \techo mod/sub >expected &&\n     @@ t/t7001-mv.sh: test_expect_success 'git mv moves a submodule with gitfile' '\n       \tmkdir mod &&\n       \tgit -C mod mv ../sub/ . &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \techo mod/sub >expected &&\n     @@ t/t7001-mv.sh: test_expect_success 'mv does not complain when no .gitmodules fil\n       \tgit mv sub mod/sub 2>actual.err &&\n       \ttest_must_be_empty actual.err &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \tgit update-index --refresh &&\n     @@ t/t7001-mv.sh: test_expect_success 'mv will error out on a modified .gitmodules\n       \tgit mv sub mod/sub 2>actual.err &&\n       \ttest_must_be_empty actual.err &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \tgit update-index --refresh &&\n     @@ t/t7001-mv.sh: test_expect_success 'mv issues a warning when section is not foun\n       \tgit mv sub mod/sub 2>actual.err &&\n       \ttest_cmp expect.err actual.err &&\n      -\t! test -e sub &&\n     -+\t! test_path_exists sub &&\n     ++\ttest_path_is_missing sub &&\n       \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n       \tgit -C mod/sub status &&\n       \tgit update-index --refresh &&\n     @@ t/t7001-mv.sh: test_expect_success 'checking out a commit before submodule moved\n       \ttest_cmp expected actual &&\n      -\t! test -f sub/.git &&\n      -\ttest -f sub2/.git &&\n     -+\t! test_path_is_file sub/.git &&\n     ++\ttest_path_is_missing sub/.git &&\n      +\ttest_path_is_file sub2/.git &&\n       \tgit submodule update &&\n      -\ttest -f sub/.git &&\n\n\n t/t7001-mv.sh | 62 +++++++++++++++++++++++++--------------------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 8c37bceb336..d72cef88264 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -60,8 +60,8 @@ test_expect_success 'checking the commit' '\n \n test_expect_success 'mv --dry-run does not move file' '\n \tgit mv -n path0/COPYING MOVED &&\n-\ttest -f path0/COPYING &&\n-\ttest ! -f MOVED\n+\ttest_path_is_file path0/COPYING &&\n+\ttest_path_is_missing MOVED\n '\n \n test_expect_success 'checking -k on non-existing file' '\n@@ -71,25 +71,25 @@ test_expect_success 'checking -k on non-existing file' '\n test_expect_success 'checking -k on untracked file' '\n \t>untracked1 &&\n \tgit mv -k untracked1 path0 &&\n-\ttest -f untracked1 &&\n-\ttest ! -f path0/untracked1\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_missing path0/untracked1\n '\n \n test_expect_success 'checking -k on multiple untracked files' '\n \t>untracked2 &&\n \tgit mv -k untracked1 untracked2 path0 &&\n-\ttest -f untracked1 &&\n-\ttest -f untracked2 &&\n-\ttest ! -f path0/untracked1 &&\n-\ttest ! -f path0/untracked2\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file untracked2 &&\n+\ttest_path_is_missing path0/untracked1 &&\n+\ttest_path_is_missing path0/untracked2\n '\n \n test_expect_success 'checking -f on untracked file with existing target' '\n \t>path0/untracked1 &&\n \ttest_must_fail git mv -f untracked1 path0 &&\n-\ttest ! -f .git/index.lock &&\n-\ttest -f untracked1 &&\n-\ttest -f path0/untracked1\n+\ttest_path_is_missing .git/index.lock &&\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file path0/untracked1\n '\n \n # clean up the mess in case bad things happen\n@@ -215,8 +215,8 @@ test_expect_success 'absolute pathname' '\n \t\tgit add sub/file &&\n \n \t\tgit mv sub \"$(pwd)/in\" &&\n-\t\t! test -d sub &&\n-\t\ttest -d in &&\n+\t\ttest_path_is_missing sub &&\n+\t\ttest_path_is_dir in &&\n \t\tgit ls-files --error-unmatch in/file\n \t)\n '\n@@ -234,8 +234,8 @@ test_expect_success 'absolute pathname outside should fail' '\n \t\tgit add sub/file &&\n \n \t\ttest_must_fail git mv sub \"$out/out\" &&\n-\t\ttest -d sub &&\n-\t\t! test -d ../in &&\n+\t\ttest_path_is_dir sub &&\n+\t\ttest_path_is_missing ../in &&\n \t\tgit ls-files --error-unmatch sub/file\n \t)\n '\n@@ -295,8 +295,8 @@ test_expect_success 'git mv should overwrite symlink to a file' '\n \tgit add moved &&\n \ttest_must_fail git mv moved symlink &&\n \tgit mv -f moved symlink &&\n-\t! test -e moved &&\n-\ttest -f symlink &&\n+\ttest_path_is_missing moved &&\n+\ttest_path_is_file symlink &&\n \ttest \"$(cat symlink)\" = 1 &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n@@ -312,13 +312,13 @@ test_expect_success 'git mv should overwrite file with a symlink' '\n \tgit add moved &&\n \ttest_must_fail git mv symlink moved &&\n \tgit mv -f symlink moved &&\n-\t! test -e symlink &&\n+\ttest_path_is_missing symlink &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n '\n \n test_expect_success SYMLINKS 'check moved symlink' '\n-\ttest -h moved\n+\ttest_path_is_symlink moved\n '\n \n rm -f moved symlink\n@@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -372,7 +372,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -389,7 +389,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \tgit -C mod mv ../sub/ . &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -408,7 +408,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -423,13 +423,13 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \ttest_must_fail git mv sub mod/sub 2>actual.err &&\n-\ttest -s actual.err &&\n-\ttest -e sub &&\n+\ttest_file_not_empty actual.err &&\n+\ttest_path_exists sub &&\n \tgit diff-files --quiet -- sub &&\n \tgit add .gitmodules &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -447,7 +447,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_cmp expect.err actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -460,7 +460,7 @@ test_expect_success 'mv --dry-run does not touch the submodule or .gitmodules' '\n \tgit submodule update &&\n \tmkdir mod &&\n \tgit mv -n sub mod/sub 2>actual.err &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet -- sub .gitmodules\n@@ -474,10 +474,10 @@ test_expect_success 'checking out a commit before submodule moved needs manual u\n \tgit status -s sub2 >actual &&\n \techo \"?? sub2/\" >expected &&\n \ttest_cmp expected actual &&\n-\t! test -f sub/.git &&\n-\ttest -f sub2/.git &&\n+\ttest_path_is_missing sub/.git &&\n+\ttest_path_is_file sub2/.git &&\n \tgit submodule update &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \trm -rf sub2 &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n\nbase-commit: 1fc3c0ad407008c2f71dd9ae1241d8b75f8ef886\n-- \ngitgitgadget\n"},{"id":"466448","messageId":"CAN0heSohT_zDYequyv9-cCALrbpR0yQnSoPA3+YGMhgKxE5K3g@mail.gmail.com","threadId":"58719","inReplyTo":"pull.1372.v2.git.git.1667500788132.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] t7001-mv.sh: modernizing test script using functions","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2022-11-03T19:37:21Z","receivedAt":"2022-11-03T19:37:37Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On Thu, 3 Nov 2022 at 19:39, Debra Obondo via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n>\n> From: Debra Obondo <debraobondo@gmail.com>\n>\n> Test script to verify the presence/absence of files, paths, directories,\n> symlinks and other features in 'git mv' command are using the command\n> format:\n>\n> 'test (-e|f|d|h|...)'\n>\n> Replace them with helper functions of format:\n>\n> 'test_path_is_*'\n\nOk.\n\n> Changes since v1\n>\n> Replacing idiomatic helper functions\n>\n> '! test_path_is_*'\n>\n> with\n>\n> 'test_path_is_missing'\n>\n\nThe above \"Changes since v1\" and what I've quoted here should probably\nbe dropped. We prefer our patches to look as if they've appeared out of\nthe blue in perfect shape. :-)\n\n> This uses values of 'test_path_bar' in place of '! test_path_foo' to\n> bring in the helpful factor of indicating the failure of tests after the\n> mv command has been used, that is, it echoes if the feature/test_path\n> exists.\n\nThis paragraph is excellent. It describes why you've done the patch this\nway. This looks much better than version 1 of the patch!\n\n> Signed-off-by: Debra Obondo <debraobondo@gmail.com>\n\nAfter removing the lines about changes since v1, this patch is\n\nReviewed-by: Martin Ågren <martin.agren@gmail.com>\n\n> ---\n>     [PATCH v2] [OUTREACHY] t7001-mv.sh : Use test_path_is_* functions in\n>     test script\n>\n>     Changes since v1:\n>\n>     Replacing idiomatic helper functions\n>\n>     '! test_path_is_*'\n>\n>     with\n>\n>     'test_path_is_missing'\n\nThis place after the \"---\" line is an excellent place for including such\n\"here's what has changed since v1\" comments. Good. They will not appear\nin the final commit message.\n\nThanks for contributing!\n\nMartin\n"},{"id":"466535","messageId":"pull.1372.v3.git.git.1667574352244.gitgitgadget@gmail.com","threadId":"58719","inReplyTo":"pull.1372.v2.git.git.1667500788132.gitgitgadget@gmail.com","subject":"[PATCH v3] t7001-mv.sh: modernizing test script using functions","fromName":"Debra Obondo via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-11-04T15:05:52Z","receivedAt":"2022-11-04T15:06:00Z","isPatch":true,"sender":{"key":"debraobondo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97498997?v=4"},"body":"From: Debra Obondo <debraobondo@gmail.com>\n\nTest script to verify the presence/absence of files, paths, directories,\nsymlinks and other features in 'git mv' command are using the command\nformat:\n\n'test (-e|f|d|h|...)'\n\nReplace them with helper functions of format:\n\n'test_path_is_*'\n\nReplacing idiomatic helper functions:\n\n'! test_path_is_*'\n\nwith\n\n'test_path_is_missing'\n\nThis uses values of 'test_path_bar' in place of '! test_path_foo' to\nbring in the helpful factor of indicating the failure of tests after the\nmv command has been used, that is, it echoes if the feature/test_path\nexists.\n\nSigned-off-by: Debra Obondo <debraobondo@gmail.com>\n---\n    [PATCH v3] [OUTREACHY] t7001-mv.sh : Use test_path_is_* functions in\n    test script\n    \n    Changes since prevous 2 versions:\n    \n    Replacing idiomatic helper functions\n    \n    '! test_path_is_*'\n    \n    with\n    \n    'test_path_is_missing'\n    \n    This uses values of 'test_path_bar' in place of '! test_path_foo' to\n    bring in the helpful factor of indicating the failure of tests after the\n    mv command has been used, that is, it echoes if the feature/test_path\n    exists .\n    \n    Older test scripts use the command 'test -' to verify the presence or\n    absence of features such as files, directories and symbolic links. This\n    however requires slightly complicated uses, such as 'test ! -f '. The\n    helper functions 'test_path_is_' located in t/test-lib-functions.sh have\n    taken into account all scenarios of the 'test -' to reduce errors. This\n    was a microproject to replace them with the helper functions.\n    \n    Test script to verify the presence/absence of files, paths,\n    directories,symboliclinks and many other features in mv command are\n    using the command format\n    \n    'test -(e|f|s|h|...).\n    \n    Replace them with helper functions of format\n    \n    'test_path_is_*'\n    \n    Signed-off-by: Debra Obondo debraobondo@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1372%2Ffobiasic07%2Ft7001-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1372/fobiasic07/t7001-v3\nPull-Request: https://github.com/git/git/pull/1372\n\nRange-diff vs v2:\n\n 1:  c6640ebff66 ! 1:  04176190ffd t7001-mv.sh: modernizing test script using functions\n     @@ Commit message\n      \n          'test_path_is_*'\n      \n     -    Changes since v1\n     -\n     -    Replacing idiomatic helper functions\n     +    Replacing idiomatic helper functions:\n      \n          '! test_path_is_*'\n      \n\n\n t/t7001-mv.sh | 62 +++++++++++++++++++++++++--------------------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 8c37bceb336..d72cef88264 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -60,8 +60,8 @@ test_expect_success 'checking the commit' '\n \n test_expect_success 'mv --dry-run does not move file' '\n \tgit mv -n path0/COPYING MOVED &&\n-\ttest -f path0/COPYING &&\n-\ttest ! -f MOVED\n+\ttest_path_is_file path0/COPYING &&\n+\ttest_path_is_missing MOVED\n '\n \n test_expect_success 'checking -k on non-existing file' '\n@@ -71,25 +71,25 @@ test_expect_success 'checking -k on non-existing file' '\n test_expect_success 'checking -k on untracked file' '\n \t>untracked1 &&\n \tgit mv -k untracked1 path0 &&\n-\ttest -f untracked1 &&\n-\ttest ! -f path0/untracked1\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_missing path0/untracked1\n '\n \n test_expect_success 'checking -k on multiple untracked files' '\n \t>untracked2 &&\n \tgit mv -k untracked1 untracked2 path0 &&\n-\ttest -f untracked1 &&\n-\ttest -f untracked2 &&\n-\ttest ! -f path0/untracked1 &&\n-\ttest ! -f path0/untracked2\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file untracked2 &&\n+\ttest_path_is_missing path0/untracked1 &&\n+\ttest_path_is_missing path0/untracked2\n '\n \n test_expect_success 'checking -f on untracked file with existing target' '\n \t>path0/untracked1 &&\n \ttest_must_fail git mv -f untracked1 path0 &&\n-\ttest ! -f .git/index.lock &&\n-\ttest -f untracked1 &&\n-\ttest -f path0/untracked1\n+\ttest_path_is_missing .git/index.lock &&\n+\ttest_path_is_file untracked1 &&\n+\ttest_path_is_file path0/untracked1\n '\n \n # clean up the mess in case bad things happen\n@@ -215,8 +215,8 @@ test_expect_success 'absolute pathname' '\n \t\tgit add sub/file &&\n \n \t\tgit mv sub \"$(pwd)/in\" &&\n-\t\t! test -d sub &&\n-\t\ttest -d in &&\n+\t\ttest_path_is_missing sub &&\n+\t\ttest_path_is_dir in &&\n \t\tgit ls-files --error-unmatch in/file\n \t)\n '\n@@ -234,8 +234,8 @@ test_expect_success 'absolute pathname outside should fail' '\n \t\tgit add sub/file &&\n \n \t\ttest_must_fail git mv sub \"$out/out\" &&\n-\t\ttest -d sub &&\n-\t\t! test -d ../in &&\n+\t\ttest_path_is_dir sub &&\n+\t\ttest_path_is_missing ../in &&\n \t\tgit ls-files --error-unmatch sub/file\n \t)\n '\n@@ -295,8 +295,8 @@ test_expect_success 'git mv should overwrite symlink to a file' '\n \tgit add moved &&\n \ttest_must_fail git mv moved symlink &&\n \tgit mv -f moved symlink &&\n-\t! test -e moved &&\n-\ttest -f symlink &&\n+\ttest_path_is_missing moved &&\n+\ttest_path_is_file symlink &&\n \ttest \"$(cat symlink)\" = 1 &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n@@ -312,13 +312,13 @@ test_expect_success 'git mv should overwrite file with a symlink' '\n \tgit add moved &&\n \ttest_must_fail git mv symlink moved &&\n \tgit mv -f symlink moved &&\n-\t! test -e symlink &&\n+\ttest_path_is_missing symlink &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n '\n \n test_expect_success SYMLINKS 'check moved symlink' '\n-\ttest -h moved\n+\ttest_path_is_symlink moved\n '\n \n rm -f moved symlink\n@@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -372,7 +372,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu\n \t) &&\n \tmkdir mod &&\n \tgit mv sub mod/sub &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -389,7 +389,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \tgit -C mod mv ../sub/ . &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \techo mod/sub >expected &&\n@@ -408,7 +408,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -423,13 +423,13 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \ttest_must_fail git mv sub mod/sub 2>actual.err &&\n-\ttest -s actual.err &&\n-\ttest -e sub &&\n+\ttest_file_not_empty actual.err &&\n+\ttest_path_exists sub &&\n \tgit diff-files --quiet -- sub &&\n \tgit add .gitmodules &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_must_be_empty actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -447,7 +447,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n \ttest_cmp expect.err actual.err &&\n-\t! test -e sub &&\n+\ttest_path_is_missing sub &&\n \ttest \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" &&\n \tgit -C mod/sub status &&\n \tgit update-index --refresh &&\n@@ -460,7 +460,7 @@ test_expect_success 'mv --dry-run does not touch the submodule or .gitmodules' '\n \tgit submodule update &&\n \tmkdir mod &&\n \tgit mv -n sub mod/sub 2>actual.err &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet -- sub .gitmodules\n@@ -474,10 +474,10 @@ test_expect_success 'checking out a commit before submodule moved needs manual u\n \tgit status -s sub2 >actual &&\n \techo \"?? sub2/\" >expected &&\n \ttest_cmp expected actual &&\n-\t! test -f sub/.git &&\n-\ttest -f sub2/.git &&\n+\ttest_path_is_missing sub/.git &&\n+\ttest_path_is_file sub2/.git &&\n \tgit submodule update &&\n-\ttest -f sub/.git &&\n+\ttest_path_is_file sub/.git &&\n \trm -rf sub2 &&\n \tgit diff-index --exit-code HEAD &&\n \tgit update-index --refresh &&\n\nbase-commit: 1fc3c0ad407008c2f71dd9ae1241d8b75f8ef886\n-- \ngitgitgadget\n"},{"id":"466561","messageId":"Y2WLlv1waMA9L8S/@nand.local","threadId":"58719","inReplyTo":"pull.1372.v3.git.git.1667574352244.gitgitgadget@gmail.com","subject":"Re: [PATCH v3] t7001-mv.sh: modernizing test script using functions","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-11-04T22:00:54Z","receivedAt":"2022-11-04T22:01:01Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"Hi Debra,\n\nOn Fri, Nov 04, 2022 at 03:05:52PM +0000, Debra Obondo via GitGitGadget wrote:\n>  t/t7001-mv.sh | 62 +++++++++++++++++++++++++--------------------------\n>  1 file changed, 31 insertions(+), 31 deletions(-)\n\nThis round looks great. Will queue, thanks.\n\nThanks,\nTaylor\n"}]}