From: Don Slutz Date: Wed, 13 May 2009 19:35:42 GMT Subject: [PATCH v2 1/7] Add GIT_TEST_AUTO_CRLF environment variable to set core.autocrlf on init Message-ID: <1242243348-6690-2-git-send-email-Don.Slutz@SierraAtlantic.com> 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 --- 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