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

[PATCH] t0020: make sure the test file is lf to start with

From
vfr@lyx.org <vfr@lyx.org>
Date
Jun 10, 2012, 10:32 UTC
Message-ID
<1339324352-7376-1-git-send-email-vfr@lyx.org>
From: Vincent van Ravesteijn <vfr@lyx.org>

On Windows, the perl interpreter used by q_to_nul also converts the eol-style to crlf. Because the eol-style is now wrong from the beginning, the later tests '.gitattributes says two is binary' and 'checkout with existing .gitattributes' fail. This patch makes sure that the eol-style is lf when the test file is setup and makes the tests to pass also on Windows.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>

--- I'm not sure everyone will like this solution to fix a problem that is only present on Windows. I'd be happy to discuss a different solution.

 t/t0020-crlf.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 1a8f44c..4c41b6e 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
 	for w in Hello world how are you; do echo $w; done >one &&
 	mkdir dir &&
 	for w in I am very very fine thank you; do echo $w; done >dir/two &&
-	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul >three &&
+	for w in Oh here is NULQin text here; do echo $w; done | q_to_nul | remove_cr >three &&
 	git add . &&
 
 	git commit -m initial &&
-- 
1.7.9.msysgit.0
Next: Johannes Schindelin
Message 1 of 4 in “t0020: make sure the test file is lf to start with”
  1. t0020: make sure the test file is lf to start withvfr@lyx.org, Jun 10, 2012
  2. Johannes SchindelinJun 10, 2012
  3. Vincent van RavesteijnJun 10, 2012
  4. Johannes SchindelinJun 10, 2012

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.