@matheusbsbs / matheus-bagliano / commits / b484ef28fb
Fork 0

trivial: use git-repo-config to detect how to run tests in the test repository

Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Alex Riesen committed Jan 5, 2006 at 12:55 UTC b484ef28fbdc3e2ac242c37507eee5ace90f3915
2 files changed +22 -7
t/t4006-diff-mode.sh
+15 -5
@@ -15,11 +15,21 @@ test_expect_success \
15 tree=`git-write-tree` &&
16 echo $tree'
17
18 -test_expect_success \
19 - 'chmod' \
20 - 'chmod +x rezrov &&
21 - git-update-index rezrov &&
22 - git-diff-index $tree >current'
18 +if [ "$(git repo-config --get core.filemode)" = false ]
19 +then
20 + say 'filemode disabled on the filesystem, using update-index --chmod=+x'
21 + test_expect_success \
22 + 'git-update-index --chmod=+x' \
23 + 'git-update-index rezrov &&
24 + git-update-index --chmod=+x rezrov &&
25 + git-diff-index $tree >current'
26 +else
27 + test_expect_success \
28 + 'chmod' \
29 + 'chmod +x rezrov &&
30 + git-update-index rezrov &&
31 + git-diff-index $tree >current'
32 +fi
33
34 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
35 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
t/t4102-apply-rename.sh
+7 -2
@@ -31,7 +31,12 @@ test_expect_success setup \
31 test_expect_success apply \
32 'git-apply --index --stat --summary --apply test-patch'
33
34 -test_expect_success validate \
35 - 'test -f bar && ls -l bar | grep "^-..x......"'
34 +if [ "$(git repo-config --get core.filemode)" = false ]
35 +then
36 + say 'filemode disabled on the filesystem'
37 +else
38 + test_expect_success validate \
39 + 'test -f bar && ls -l bar | grep "^-..x......"'
40 +fi
41
42 test_done