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

Re: [PATCH] blame.c: Properly initialize strbuf after calling, textconv_object()

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2011, 16:44 UTC
Message-ID
<7vhb2tt6ag.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAHGBnuPUGfOe1D_OZ0ga4s8EiS_=GZeBG7WLmyOHt7vNg+w3Fw@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 6 quoted lines
> On Fri, Oct 28, 2011 at 18:00, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Thanks; do you have no addition to the test suite to demonstrate the
>> breakage?
>
> Not yet. I'll try to come up with something.
Let's do this.
diff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh
index 32ec82a..4ee42f1 100755
--- a/t/t8006-blame-textconv.sh
+++ b/t/t8006-blame-textconv.sh
@@ -15,6 +15,7 @@ EOF
 chmod +x helper
 
 test_expect_success 'setup ' '
+	echo "bin: test number 0" >zero.bin &&
 	echo "bin: test 1" >one.bin &&
 	echo "bin: test number 2" >two.bin &&
 	if test_have_prereq SYMLINKS; then
@@ -43,6 +44,7 @@ test_expect_success 'no filter specified' '
 
 test_expect_success 'setup textconv filters' '
 	echo "*.bin diff=test" >.gitattributes &&
+	echo "zero.bin eol=crlf" >>.gitattributes &&
 	git config diff.test.textconv ./helper &&
 	git config diff.test.cachetextconv false
 '
@@ -74,6 +76,15 @@ test_expect_success 'blame --textconv going through revisions' '
 	test_cmp expected result
 '
 
+test_expect_success 'blame --textconv with local changes' '
+	test_when_finished "git checkout zero.bin" &&
+	printf "bin: updated number 0\015" >zero.bin &&
+	git blame --textconv zero.bin >blame &&
+	expect="(Not Committed Yet ....-..-.. ..:..:.. +0000 1)" &&
+	expect="$expect converted: updated number 0" &&
+	expr "$(find_blame <blame)" : "^$expect"
+'
+
 test_expect_success 'setup +cachetextconv' '
 	git config diff.test.cachetextconv true
 '
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 4 of 8 in “blame.c: Properly initialize strbuf after calling, textconv_object()”
  1. blame.c: Properly initialize strbuf after calling, textconv_object()Sebastian Schuberth, Oct 28, 2011
  2. Junio C HamanoOct 28, 2011
  3. Sebastian SchuberthOct 28, 2011
  4. Junio C HamanoOct 28, 2011
  5. Sebastian SchuberthOct 28, 2011
  6. Junio C HamanoOct 28, 2011
  7. Sebastian SchuberthOct 28, 2011
  8. Sebastian SchuberthOct 31, 2011

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.