Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH] blame: add a failing test for a CRLF issue.

From: brian m. carlson <hidden>
Date: 2016-06-15 22:59:57
Subsystem: the rest · Maintainer: Linus Torvalds

If a file contains CRLF line endings in a repository with
core.autocrlf=input, then blame always marks the lines as "Not Committed
Yet", even if they are unmodified.  Add a failing test for this case, so we
are at least aware of this issue.

Reported-by: Ephrim Khong <redacted>
Signed-off-by: brian m. carlson <redacted>
---

Obviously, this doesn't actually fix the issue, but at least we're aware of it
so we don't lose track of it and can fix it.  A future patch can mark the test
passing.

 t/t8003-blame-corner-cases.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index e7cac1d..903f775 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -191,4 +191,14 @@ test_expect_success 'indent of line numbers, ten lines' '
 	test $(grep -c "  " actual) = 9
 '
 
+test_expect_failure 'blaming files with CRLF newlines' '
+	git config core.autocrlf false &&
+	printf "testcase\r\n" >crlffile &&
+	git add crlffile &&
+	git commit -m testcase &&
+	git config core.autocrlf input &&
+	git blame crlffile >actual &&
+	grep "A U Thor" actual
+'
+
 test_done
-- 
1.9.0.rc3.1008.gd08b47c.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help