{"thread":{"id":"49159","subject":"[RFC PATCH] t7508-status: fix a bogus check in a submodule-related test","startedAt":"2018-08-18T17:56:59Z","lastAt":"2018-08-18T17:56:59Z","messageCount":1,"participants":["SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"356003","messageId":"20180818175606.24108-1-szeder.dev@gmail.com","threadId":"49159","inReplyTo":null,"subject":"[RFC PATCH] t7508-status: fix a bogus check in a submodule-related test","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-18T17:56:06Z","receivedAt":"2018-08-18T17:56:59Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Since 90e14525f2 (Add tests for the diff.ignoreSubmodules config\noption, 2010-08-06) the test '.gitmodules ignore=dirty suppresses\nsubmodules with untracked content' in 't7508-status.sh' contains a\ncheck that is bogus for two reasons.\n\nThe commit in question added the following three lines at the\nbeginning of that test:\n\n  git config diff.ignoreSubmodules dirty &&\n  git status >output &&\n  ! test -s actual &&\n\nThat 'test' is problematic, because:\n\n  - The output of 'git status' is saved in the file 'output', but the\n    subsequent 'test' looks at the file 'actual'.  This is the first\n    mention of 'actual' in t7508, so that file doesn't exist at that\n    point, and, consequently, the 'test' itself fails.  However, since\n    there is a '!' in front to flip the exit code, the command as a\n    whole succeeds.\n    I guess that this 'test' should look at the file 'output' instead,\n    but...\n\n  - This whole command checks that the given file is empty, i.e. that,\n    supposedly, 'git status' produced no output.  However, in this\n    case 'git status' does produce output, and indeed it should\n    produce the same output as already expected in the neighbouring\n    tests or even later in the same test, all running 'git status' in\n    similar situations.\n\nSo drop that bogus check, and verify that 'git status's output matches\nwhat's otherwise expected in similar cases.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nThis is a submodules-related test, and I'm not very well versed in\nsubmodules, hence the RFC.\n\n t/t7508-status.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex e1f11293e2..4ea528785a 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1183,7 +1183,7 @@ test_expect_success '--ignore-submodules=dirty suppresses submodules with untrac\n test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n \ttest_config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n-\t! test -s actual &&\n+\ttest_i18ncmp expect output &&\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status >output &&\n-- \n2.18.0.903.gab616d7dc6\n\n"}]}