{"thread":{"id":"49194","subject":"[PATCH 1/2] t3903-stash: don't try to grep non-existing file","startedAt":"2018-08-22T18:13:38Z","lastAt":"2018-08-22T18:13:51Z","messageCount":2,"participants":["SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"356294","messageId":"20180822181320.14055-1-szeder.dev@gmail.com","threadId":"49194","inReplyTo":null,"subject":"[PATCH 1/2] t3903-stash: don't try to grep non-existing file","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-22T18:13:19Z","receivedAt":"2018-08-22T18:13:38Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"The test 'store updates stash ref and reflog' in 't3903-stash.sh'\ncreates a stash from a new file, runs 'git reset --hard' to throw away\nany modifications to the work tree, and then runs '! grep' to ensure\nthat the staged contents are gone.  Since the file didn't exist\nbefore, it shouldn't exist after 'git reset' either.  Consequently,\nthis 'grep' doesn't fail as expected, because it can't find the staged\ncontent, but it fails because it can't open the file.\n\nTighten this check by using 'test_path_is_missing' instead, thereby\navoiding an unexpected error from 'grep' as well.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t3903-stash.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 1f871d3cca..6450bc6698 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -724,7 +724,7 @@ test_expect_success 'store updates stash ref and reflog' '\n \tgit add bazzy &&\n \tSTASH_ID=$(git stash create) &&\n \tgit reset --hard &&\n-\t! grep quux bazzy &&\n+\ttest_path_is_missing bazzy &&\n \tgit stash store -m quuxery $STASH_ID &&\n \ttest $(git rev-parse stash) = $STASH_ID &&\n \tgit reflog --format=%H stash| grep $STASH_ID &&\n-- \n2.19.0.rc0.136.gd2dd172e64\n\n"},{"id":"356295","messageId":"20180822181320.14055-2-szeder.dev@gmail.com","threadId":"49194","inReplyTo":"20180822181320.14055-1-szeder.dev@gmail.com","subject":"[PATCH 2/2] t3420-rebase-autostash: don't try to grep non-existing files","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-22T18:13:20Z","receivedAt":"2018-08-22T18:13:51Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Several tests in 't3420-rebase-autostash.sh' start various rebase\nprocesses that are expected to fail because of merge conflicts.  These\ntests then run '! grep' to ensure that the autostash feature did its\njob, and the dirty contents of a file is gone.  However, due to the\ntest repo's history and the choice of upstream branch that file\nshouldn't exist in the conflicted state at all.  Consequently, this\n'grep' doesn't fail as expected, because it can't find the dirty\ncontent, but it fails because it can't open the file.\n\nTighten this check by using 'test_path_is_missing' instead, thereby\navoiding unexpected errors from 'grep' as well.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t3420-rebase-autostash.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh\nindex e243700660..0c4eefec76 100755\n--- a/t/t3420-rebase-autostash.sh\n+++ b/t/t3420-rebase-autostash.sh\n@@ -202,7 +202,7 @@ testrebase () {\n \t\techo dirty >>file3 &&\n \t\ttest_must_fail git rebase$type related-onto-branch &&\n \t\ttest_path_is_file $dotest/autostash &&\n-\t\t! grep dirty file3 &&\n+\t\ttest_path_is_missing file3 &&\n \t\trm -rf $dotest &&\n \t\tgit reset --hard &&\n \t\tgit checkout feature-branch\n@@ -216,7 +216,7 @@ testrebase () {\n \t\techo dirty >>file3 &&\n \t\ttest_must_fail git rebase$type related-onto-branch &&\n \t\ttest_path_is_file $dotest/autostash &&\n-\t\t! grep dirty file3 &&\n+\t\ttest_path_is_missing file3 &&\n \t\techo \"conflicting-plus-goodbye\" >file2 &&\n \t\tgit add file2 &&\n \t\tgit rebase --continue &&\n@@ -233,7 +233,7 @@ testrebase () {\n \t\techo dirty >>file3 &&\n \t\ttest_must_fail git rebase$type related-onto-branch &&\n \t\ttest_path_is_file $dotest/autostash &&\n-\t\t! grep dirty file3 &&\n+\t\ttest_path_is_missing file3 &&\n \t\tgit rebase --skip &&\n \t\ttest_path_is_missing $dotest/autostash &&\n \t\tgrep dirty file3 &&\n@@ -248,7 +248,7 @@ testrebase () {\n \t\techo dirty >>file3 &&\n \t\ttest_must_fail git rebase$type related-onto-branch &&\n \t\ttest_path_is_file $dotest/autostash &&\n-\t\t! grep dirty file3 &&\n+\t\ttest_path_is_missing file3 &&\n \t\tgit rebase --abort &&\n \t\ttest_path_is_missing $dotest/autostash &&\n \t\tgrep dirty file3 &&\n-- \n2.19.0.rc0.136.gd2dd172e64\n\n"}]}