From: Don Slutz <Don.Slutz@SierraAtlantic.com>
To: git@vger.kernel.org
Cc: Don Slutz <Don.Slutz@SierraAtlantic.com>
Subject: [PATCH v2 1/7] Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on init
Date: Wed, 13 May 2009 15:35:42 -0400 [thread overview]
Message-ID: <1242243348-6690-2-git-send-email-Don.Slutz@SierraAtlantic.com> (raw)
In-Reply-To: <1242243348-6690-1-git-send-email-Don.Slutz@SierraAtlantic.com>
Normal usage:
GIT_TEST_AUTO_CRLF=true make test
Signed-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com>
---
t/test-lib.sh | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index dad1437..6178e8c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -59,7 +59,12 @@ export GIT_MERGE_VERBOSITY
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
export EDITOR VISUAL
-GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
+
+if test ! -z $GIT_TEST_AUTO_CRLF && test $GIT_TEST_AUTO_CRLF = true; then
+ GIT_TEST_CMP=${GIT_TEST_CMP:-diff -uw}
+else
+ GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
+fi
# Protect ourselves from common misconfiguration to export
# CDPATH into the environment
@@ -493,6 +498,11 @@ test_create_repo () {
cd "$repo" || error "Cannot setup test environment"
"$GIT_EXEC_PATH/git-init" "--template=$TEST_DIRECTORY/../templates/blt/" >&3 2>&4 ||
error "cannot run git init -- have you built things yet?"
+ test ! -z "$GIT_TEST_AUTO_CRLF" &&
+ test_debug "echo Switching to autocrlf=$GIT_TEST_AUTO_CRLF" && {
+ git config core.autocrlf $GIT_TEST_AUTO_CRLF ||
+ error "Failed to switch to autocrlf=$GIT_TEST_AUTO_CRLF"
+ }
mv .git/hooks .git/hooks-disabled
cd "$owd"
}
--
1.6.3.15.g49878
next prev parent reply other threads:[~2009-05-13 19:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 19:28 [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests Don Slutz
2009-05-11 19:28 ` [PATCH 1/6] " Don Slutz
2009-05-11 19:28 ` [PATCH 2/6] Fix tests to work with core.autocrlf=true Don Slutz
2009-05-11 19:28 ` [PATCH 3/6] " Don Slutz
2009-05-11 19:28 ` [PATCH 4/6] " Don Slutz
2009-05-11 19:29 ` [PATCH 5/6] " Don Slutz
2009-05-11 19:29 ` [PATCH 6/6] Add 'make test-text' Don Slutz
2009-05-11 22:20 ` [PATCH 3/6] Fix tests to work with core.autocrlf=true Charles Bailey
2009-05-14 13:49 ` Don Slutz
2009-05-11 20:04 ` [PATCH 0/6] Add core.autocrlf=true on cygwin by default during tests Eric Blake
2009-05-12 23:27 ` Junio C Hamano
2009-05-13 17:41 ` Junio C Hamano
2009-05-11 20:54 ` Johannes Schindelin
2009-05-12 18:16 ` Don Slutz
2009-05-13 19:35 ` [PATCH v2 0/7] Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on init Don Slutz
2009-05-13 19:35 ` Don Slutz [this message]
2009-05-13 19:35 ` [PATCH v2 2/7] Add support functions for tests in core.autocrlf=true Don Slutz
2009-05-13 19:35 ` [PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions Don Slutz
2009-05-13 19:35 ` [PATCH v2 4/7] Fix tests to work with core.autocrlf=true -- force false Don Slutz
2009-05-13 19:35 ` [PATCH v2 5/7] Fix tests to work with core.autocrlf=true -- cmp to test_cmp Don Slutz
2009-05-13 19:35 ` [PATCH v2 6/7] Fix tests to work with core.autocrlf=true -- test_cmp to cmp Don Slutz
2009-05-13 19:35 ` [PATCH v2 7/7] Add 'make test-text' core.autocrlf=true Don Slutz
2009-05-14 7:43 ` [PATCH v2 3/7] Fix tests to work with core.autocrlf=true -- new functions Charles Bailey
2009-05-14 14:39 ` Don Slutz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1242243348-6690-2-git-send-email-Don.Slutz@SierraAtlantic.com \
--to=don.slutz@sierraatlantic.com \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).