[PATCH 2/2] sh-setup: explicitly mark CR as a field separator
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 25, 2015, 12:50 UTC
- Message-ID
- <214d877df18f3189b1809946817aab9765450ea9.1445777347.git.johannes.schindelin@gmx.de>
- In-Reply-To
- <cover.1445777347.git.johannes.schindelin@gmx.de>
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@gmx.de> --- git-sh-setup.sh | 2 +- t/t3404-rebase-interactive.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 4691fbc..94dfe04 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -13,7 +13,7 @@ unset CDPATH # do not equate an unset IFS with IFS with the default, so here is # an explicit SP HT LF. IFS=' -' +'"$(printf '')" 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 "" >"$1".new &&
-- 2.1.4