Anonymous avatar Anonymous committed b484ef2

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>;

Comments (0)

Files changed (2)

t/t4006-diff-mode.sh

      tree=`git-write-tree` &&
      echo $tree'
 
-test_expect_success \
-    'chmod' \
-    'chmod +x rezrov &&
-     git-update-index rezrov &&
-     git-diff-index $tree >current'
+if [ "$(git repo-config --get core.filemode)" = false ]
+then
+	say 'filemode disabled on the filesystem, using update-index --chmod=+x'
+	test_expect_success \
+	    'git-update-index --chmod=+x' \
+	    'git-update-index rezrov &&
+	     git-update-index --chmod=+x rezrov &&
+	     git-diff-index $tree >current'
+else
+	test_expect_success \
+	    'chmod' \
+	    'chmod +x rezrov &&
+	     git-update-index rezrov &&
+	     git-diff-index $tree >current'
+fi
 
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"

t/t4102-apply-rename.sh

 test_expect_success apply \
     'git-apply --index --stat --summary --apply test-patch'
 
-test_expect_success validate \
-    'test -f bar && ls -l bar | grep "^-..x......"'
+if [ "$(git repo-config --get core.filemode)" = false ]
+then
+	say 'filemode disabled on the filesystem'
+else
+	test_expect_success validate \
+	    'test -f bar && ls -l bar | grep "^-..x......"'
+fi
 
 test_done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.