From: Johannes Schindelin Date: Sun, 25 Oct 2015 14:10:25 GMT Subject: [PATCH v2 2/2] sh-setup: explicitly mark CR as a field separator Message-ID: <2b089201404299257f23b3931499ea16202f0f65.1445782122.git.johannes.schindelin@gmx.de> In-Reply-To: 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 --- 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