[PATCH 1/6] Add core.autocrlf=true on cygwin by default during tests
- From
- Don Slutz <don.slutz@sierraatlantic.com>
- Date
- May 11, 2009, 19:28 UTC
- Message-ID
- <1242070141-2936-2-git-send-email-Don.Slutz@SierraAtlantic.com>
- In-Reply-To
- <1242070141-2936-1-git-send-email-Don.Slutz@SierraAtlantic.com>
It can be disabled or enabled by using the GIT_TEST_AUTO_CRLF environment variable.
Signed-off-by: Don Slutz <Don.Slutz@SierraAtlantic.com> --- t/test-lib.sh | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh index dad1437..218bd82 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -119,6 +119,17 @@ do esac done +# Switch to core.autolf = true on cygwin but only by default +case $(uname -s) in +*CYGWIN*) + GIT_TEST_AUTO_CRLF=${GIT_TEST_AUTO_CRLF:-true} + test "$debug" = "" || + echo "Test in mode" $(cygpath --mode . | cut -d: -f2-) "mount" + ;; +*) + ;; +esac + if test -n "$color"; then say_color () { ( @@ -493,6 +504,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