[PATCH v2 2/2] sh-setup: explicitly mark CR as a field separator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is the correct thing to do, really: we already specify LF as
field separator.

Incidentally, this fixes the problem interactive rebase has when the
editor wants to save text with CR/LF line endings, as WordPad does
in Windows 10.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 git-sh-setup.sh               | 4 ++--
 t/t3404-rebase-interactive.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 4691fbc..e34673d 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -11,9 +11,9 @@ unset CDPATH
 
 # Similarly for IFS, but some shells (e.g. FreeBSD 7.2) are buggy and
 # do not equate an unset IFS with IFS with the default, so here is
-# an explicit SP HT LF.
+# an explicit SP HT LF CR.
 IFS=' 	
-'
+'"$(printf '\r')"
 
 git_broken_path_fix () {
 	case ":$PATH:" in
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 5dfa16a..98eb49a 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1261,7 +1261,7 @@ test_expect_success 'static check of bad SHA-1' '
 	test E = $(git cat-file commit HEAD | sed -ne \$p)
 '
 
-test_expect_failure 'editor saves as CR/LF' '
+test_expect_success 'editor saves as CR/LF' '
 	git checkout -b with-crlf &&
 	write_script add-crs.sh <<-\EOF &&
 	sed -e "s/\$/Q/" <"$1" | tr Q "\\015" >"$1".new &&
-- 
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]