git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/9] test: make FILEMODE a lazy prereq

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 25, 2013, 21:02 UTC
Message-ID
<20131125210216.GX4212@google.com>
In-Reply-To
<20131125205119.GQ4212@google.com>

This way, test authors don't need to remember to source lib-prereq-FILEMODE.sh before using the FILEMODE prereq to guard tests that rely on the executable bit being honored when checking out files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 t/lib-prereq-FILEMODE.sh       | 11 -----------
 t/t3701-add-interactive.sh     |  1 -
 t/t4102-apply-rename.sh        |  1 -
 t/t4120-apply-popt.sh          |  1 -
 t/t4129-apply-samemode.sh      |  1 -
 t/t6031-merge-recursive.sh     |  1 -
 t/t9200-git-cvsexportcommit.sh |  1 -
 t/test-lib.sh                  |  4 ++++
 8 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 t/lib-prereq-FILEMODE.sh
diff --git a/t/lib-prereq-FILEMODE.sh b/t/lib-prereq-FILEMODE.sh
deleted file mode 100644
index bce5a4c..0000000
--- a/t/lib-prereq-FILEMODE.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
-#
-
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 9dc91d0..24ddd8a 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -2,7 +2,6 @@
 
 test_description='add -i basic tests'
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL
 then
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh
index e3ea3d5..49e2d6c 100755
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
@@ -7,7 +7,6 @@ test_description='git apply handling copy/rename patch.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 # setup
 
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index c5fecdf..497b628 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -6,7 +6,6 @@
 test_description='git apply -p handling.'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	mkdir sub &&
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index 0d36ebd..c268298 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -3,7 +3,6 @@
 test_description='applying patch with mode bits'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	echo original >file &&
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
index 1cd649e..a953f1b 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -2,7 +2,6 @@
 
 test_description='merge-recursive: handle file mode'
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success 'mode change in one branch: keep changed version' '
 	: >file1 &&
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 3fb3368..812c9cd 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -5,7 +5,6 @@
 test_description='Test export of commits to CVS'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL; then
 	skip_all='skipping git cvsexportcommit tests, perl not available'
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b25249e..5968157 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -830,6 +830,10 @@ test_lazy_prereq SYMLINKS '
 	ln -s x y && test -h y
 '
 
+test_lazy_prereq FILEMODE '
+	test "$(git config --bool core.filemode)" = true
+'
+
 test_lazy_prereq CASE_INSENSITIVE_FS '
 	echo good >CamelCase &&
 	echo bad >camelcase &&
-- 
1.8.4.1
Previous: Jonathan NiederNext: Jonathan Nieder
Message 9 of 13 in “War on #! lines in shell libraries”
  1. 0/9 War on #! lines in shell librariesJonathan Nieder, Nov 25, 2013
  2. 1/9 mark Windows build scripts executableJonathan Nieder, Nov 25, 2013
  3. 2/9 mark perl test scripts executableJonathan Nieder, Nov 25, 2013
  4. 3/9 mark contributed hooks executableJonathan Nieder, Nov 25, 2013
  5. 4/9 contrib: remove git-p4importJonathan Nieder, Nov 25, 2013
  6. Pete WyckoffNov 26, 2013
  7. 5/9 gitk: chmod +x po2msgJonathan Nieder, Nov 25, 2013
  8. 6/9 git-gui: chmod +x po2msg, windows/git-gui.shJonathan Nieder, Nov 25, 2013
  9. 7/9 test: make FILEMODE a lazy prereqJonathan Nieder, Nov 25, 2013
  10. 8/9 test: replace shebangs with descriptions in shell librariesJonathan Nieder, Nov 25, 2013
  11. Eric SunshineNov 26, 2013
  12. 8/9 test: replace shebangs with descriptions in shell librariesJonathan Nieder, Nov 26, 2013
  13. 9/9 remove #!interpreter line from shell librariesJonathan Nieder, Nov 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.