git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 01/10] tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh
Date: Fri, 13 Aug 2010 20:40:04 +0000	[thread overview]
Message-ID: <1281732013-18284-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1281732013-18284-1-git-send-email-avarab@gmail.com>

Change the five tests that were all checking "git config --bool
core.filemode" to use a new FILEMODE prerequisite in
lib-prereq-FILEMODE.sh.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/lib-prereq-FILEMODE.sh       |   11 +++++++++++
 t/t3701-add-interactive.sh     |    8 +-------
 t/t4102-apply-rename.sh        |    8 +-------
 t/t4129-apply-samemode.sh      |    8 +-------
 t/t6031-merge-recursive.sh     |    6 +-----
 t/t9200-git-cvsexportcommit.sh |    6 +-----
 6 files changed, 16 insertions(+), 31 deletions(-)
 create mode 100644 t/lib-prereq-FILEMODE.sh

diff --git a/t/lib-prereq-FILEMODE.sh b/t/lib-prereq-FILEMODE.sh
new file mode 100644
index 0000000..bce5a4c
--- /dev/null
+++ b/t/lib-prereq-FILEMODE.sh
@@ -0,0 +1,11 @@
+#!/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 7ad8465..75ec90b 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -2,6 +2,7 @@
 
 test_description='add -i basic tests'
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL; then
 	skip_all='skipping git add -i tests, perl not available'
@@ -152,13 +153,6 @@ test_expect_success 'skip files similarly as commit -a' '
 '
 rm -f .gitignore
 
-if test "$(git config --bool core.filemode)" = false
-then
-	say '# skipping filemode tests (filesystem does not properly support modes)'
-else
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE 'patch does not affect mode' '
 	git reset --hard &&
 	echo content >>file &&
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh
index 1597965..e3ea3d5 100755
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
@@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch.
 
 '
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 # setup
 
@@ -31,13 +32,6 @@ test_expect_success setup \
 test_expect_success apply \
     'git apply --index --stat --summary --apply test-patch'
 
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE validate \
 	    'test -f bar && ls -l bar | grep "^-..x......"'
 
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index fc7af04..0d36ebd 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -3,13 +3,7 @@
 test_description='applying patch with mode bits'
 
 . ./test-lib.sh
-
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
+. "$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 8a3304f..66167e3 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -2,11 +2,7 @@
 
 test_description='merge-recursive: handle file mode'
 . ./test-lib.sh
-
-if ! test "$(git config --bool core.filemode)" = false
-then
-	test_set_prereq FILEMODE
-fi
+. "$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 ee39b36..e5da65b 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -5,6 +5,7 @@
 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'
@@ -229,11 +230,6 @@ test_expect_success \
       test_must_fail git cvsexportcommit -c $id
       )'
 
-if ! test "$(git config --bool core.filemode)" = false
-then
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE \
      'Retain execute bit' \
      'mkdir G &&
-- 
1.7.2.1.338.gf2379

  reply	other threads:[~2010-08-13 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 20:40 [PATCH 00/10] More test suite prerequisite cleanup Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` Ævar Arnfjörð Bjarmason [this message]
2010-08-13 20:40 ` [PATCH 02/10] t/t3701-add-interactive.sh: change from skip_all=* to prereq skip Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 03/10] lib-patch-mode tests: " Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 04/10] t/t9600-cvsimport.sh: " Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 05/10] t/t9001-send-email.sh: Remove needless PROG=* assignment Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 06/10] t/t9001-send-email.sh: change from skip_all=* to prereq skip Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 07/10] t/t9001-send-email.sh: convert setup code to tests Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 08/10] t/t7105-reset-patch.sh: Add a PERL prerequisite Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 09/10] t/t9601-cvsimport-vendor-branch.sh: " Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 10/10] t/t9602-cvsimport-branches-tags.sh: " Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281732013-18284-2-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).