{"thread":{"id":"2980","subject":"trivial: use git-repo-config to detect how to run tests in the test repository","startedAt":"2006-01-05T11:55:58Z","lastAt":"2006-01-05T11:55:58Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14182","messageId":"81b0412b0601050355i78a7a71dm852bfdad5ad3648b@mail.gmail.com","threadId":"2980","inReplyTo":null,"subject":"trivial: use git-repo-config to detect how to run tests in the test repository","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-01-05T11:55:58Z","receivedAt":"2006-01-05T11:55:58Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Signed-off-by: Alex Riesen <raa.lkml@gmail.com>\n\n\nSubject: [PATCH] use git-repo-config\n\nto detect how to run the test in the test repository\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n\n\n---\n\n t/t4006-diff-mode.sh    |   20 +++++++++++++++-----\n t/t4102-apply-rename.sh |    9 +++++++--\n 2 files changed, 22 insertions(+), 7 deletions(-)\n\n306a058f3f3d2a8a420ec4de786398ec77b0fc83\ndiff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh\nindex e2a67e9..8ad69d1 100755\n--- a/t/t4006-diff-mode.sh\n+++ b/t/t4006-diff-mode.sh\n@@ -15,11 +15,21 @@ test_expect_success \\\n      tree=`git-write-tree` &&\n      echo $tree'\n \n-test_expect_success \\\n-    'chmod' \\\n-    'chmod +x rezrov &&\n-     git-update-index rezrov &&\n-     git-diff-index $tree >current'\n+if [ \"$(git repo-config --get core.filemode)\" = false ]\n+then\n+\tsay 'filemode disabled on the filesystem, using update-index --chmod=+x'\n+\ttest_expect_success \\\n+\t    'git-update-index --chmod=+x' \\\n+\t    'git-update-index rezrov &&\n+\t     git-update-index --chmod=+x rezrov &&\n+\t     git-diff-index $tree >current'\n+else\n+\ttest_expect_success \\\n+\t    'chmod' \\\n+\t    'chmod +x rezrov &&\n+\t     git-update-index rezrov &&\n+\t     git-diff-index $tree >current'\n+fi\n \n _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex 0401d7b..fbb508d 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -31,7 +31,12 @@ test_expect_success setup \\\n test_expect_success apply \\\n     'git-apply --index --stat --summary --apply test-patch'\n \n-test_expect_success validate \\\n-    'test -f bar && ls -l bar | grep \"^-..x......\"'\n+if [ \"$(git repo-config --get core.filemode)\" = false ]\n+then\n+\tsay 'filemode disabled on the filesystem'\n+else\n+\ttest_expect_success validate \\\n+\t    'test -f bar && ls -l bar | grep \"^-..x......\"'\n+fi\n \n test_done\n-- \n1.0.GIT\n"}]}