{"thread":{"id":"42976","subject":"[PATCH v3 2/3] t3700: merge two tests into one","startedAt":"2016-07-30T20:20:02Z","lastAt":"2016-07-30T20:20:02Z","messageCount":1,"participants":["Ingo Brückl"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"292662","messageId":"579d0a83.7ea9341c.bm001@wupperonline.de","threadId":"42976","inReplyTo":null,"subject":"[PATCH v3 2/3] t3700: merge two tests into one","fromName":"Ingo Brückl","fromEmail":"ib@wupperonline.de","sentAt":"2016-07-30T20:13:48Z","receivedAt":"2016-07-30T20:20:02Z","isPatch":true,"sender":{"key":"ib@wupperonline.de","avatar":"https://avatars.githubusercontent.com/u/123327?v=4"},"body":"Depending on the underlying platform a chmod may be a noop. Although it\nwouldn't harm the result of the '--chmod=-x' test, there is a more\nrobust way to make sure the --chmod option works both ways.\n\nMerge the two separate tests for the --chmod option into one, checking\nboth permissions on the same file.\n\nSigned-off-by: Ingo Brückl <ib@wupperonline.de>\n---\n t/t3700-add.sh | 18 ++++++------------\n 1 file changed, 6 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 494f5b8..1fa5dfd 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -332,24 +332,18 @@ test_expect_success 'git add --dry-run --ignore-missing of non-existing file out\n \ttest_i18ncmp expect.err actual.err\n '\n\n-test_expect_success 'git add --chmod=+x stages a non-executable file with +x' '\n+test_expect_success 'git add --chmod=[+-]x stages correctly' '\n \trm -f foo1 &&\n \techo foo >foo1 &&\n \tgit add --chmod=+x foo1 &&\n \tcase \"$(git ls-files --stage foo1)\" in\n \t100755\" \"*foo1) echo pass;;\n \t*) echo fail; git ls-files --stage foo1; (exit 1);;\n-\tesac\n-'\n-\n-test_expect_success 'git add --chmod=-x stages an executable file with -x' '\n-\trm -f xfoo1 &&\n-\techo foo >xfoo1 &&\n-\tchmod 755 xfoo1 &&\n-\tgit add --chmod=-x xfoo1 &&\n-\tcase \"$(git ls-files --stage xfoo1)\" in\n-\t100644\" \"*xfoo1) echo pass;;\n-\t*) echo fail; git ls-files --stage xfoo1; (exit 1);;\n+\tesac &&\n+\tgit add --chmod=-x foo1 &&\n+\tcase \"$(git ls-files --stage foo1)\" in\n+\t100644\" \"*foo1) echo pass;;\n+\t*) echo fail; git ls-files --stage foo1; (exit 1);;\n \tesac\n '\n\n--\n2.9.2\n"}]}