{"thread":{"id":"42965","subject":"[PATCH v2 3/3] Simplify test t3700-add.sh","startedAt":"2016-07-29T21:19:26Z","lastAt":"2016-07-29T21:19:26Z","messageCount":1,"participants":["Ingo Brückl"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"292561","messageId":"579bc6ca.12c67c12.bm002@wupperonline.de","threadId":"42965","inReplyTo":null,"subject":"[PATCH v2 3/3] Simplify test t3700-add.sh","fromName":"Ingo Brückl","fromEmail":"ib@wupperonline.de","sentAt":"2016-07-29T21:12:38Z","receivedAt":"2016-07-29T21:19:26Z","isPatch":true,"sender":{"key":"ib@wupperonline.de","avatar":"https://avatars.githubusercontent.com/u/123327?v=4"},"body":"Utilize the test_mode_in_index helper function.\n\nSigned-off-by: Ingo Brückl <ib@wupperonline.de>\n---\n t/t3700-add.sh | 30 ++++++------------------------\n 1 file changed, 6 insertions(+), 24 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex c08ec9e..0e21a52 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -25,18 +25,12 @@ test_expect_success \\\n \t echo foo >xfoo1 &&\n \t chmod 755 xfoo1 &&\n \t git add xfoo1 &&\n-\t case \"$(git ls-files --stage xfoo1)\" in\n-\t 100644\" \"*xfoo1) echo pass;;\n-\t *) echo fail; git ls-files --stage xfoo1; (exit 1);;\n-\t esac'\n+\t test_mode_in_index 100644 xfoo1'\n\n test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo1 &&\n \ttest_ln_s_add foo xfoo1 &&\n-\tcase \"$(git ls-files --stage xfoo1)\" in\n-\t120000\" \"*xfoo1) echo pass;;\n-\t*) echo fail; git ls-files --stage xfoo1; (exit 1);;\n-\tesac\n+\ttest_mode_in_index 120000 xfoo1\n '\n\n test_expect_success \\\n@@ -45,28 +39,19 @@ test_expect_success \\\n \t echo foo >xfoo2 &&\n \t chmod 755 xfoo2 &&\n \t git update-index --add xfoo2 &&\n-\t case \"$(git ls-files --stage xfoo2)\" in\n-\t 100644\" \"*xfoo2) echo pass;;\n-\t *) echo fail; git ls-files --stage xfoo2; (exit 1);;\n-\t esac'\n+\t test_mode_in_index 100644 xfoo2'\n\n test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo2 &&\n \ttest_ln_s_add foo xfoo2 &&\n-\tcase \"$(git ls-files --stage xfoo2)\" in\n-\t120000\" \"*xfoo2) echo pass;;\n-\t*) echo fail; git ls-files --stage xfoo2; (exit 1);;\n-\tesac\n+\ttest_mode_in_index 120000 xfoo2\n '\n\n test_expect_success \\\n \t'git update-index --add: Test that executable bit is not used...' \\\n \t'git config core.filemode 0 &&\n \t test_ln_s_add xfoo2 xfoo3 &&\t# runs git update-index --add\n-\t case \"$(git ls-files --stage xfoo3)\" in\n-\t 120000\" \"*xfoo3) echo pass;;\n-\t *) echo fail; git ls-files --stage xfoo3; (exit 1);;\n-\t esac'\n+\t test_mode_in_index 120000 xfoo3'\n\n test_expect_success '.gitignore test setup' '\n \techo \"*.ig\" >.gitignore &&\n@@ -347,10 +332,7 @@ test_expect_success POSIXPERM,SYMLINKS 'git add --chmod=+x with symlinks' '\n \trm -f foo2 &&\n \techo foo >foo2 &&\n \tgit add --chmod=+x foo2 &&\n-\tcase \"$(git ls-files --stage foo2)\" in\n-\t100755\" \"*foo2) echo pass;;\n-\t*) echo fail; git ls-files --stage foo2; (exit 1);;\n-\tesac\n+\ttest_mode_in_index 100755 foo2\n '\n\n test_done\n--\n2.9.2\n\n"}]}