Hi -
On 6/4/19 12:38 PM, Barret Rhoden wrote:
I'll try to come up with a test, independent of my blame-ignore work,
that can get in that block.
I have a test that covers blame_coalesce(), which works both with and
without my blame-ignore commit that started this thread.
However, the only thing we are really testing is that git blame didn't
crash. There is no detectable change to the output. AFAIK,
blame_coalesce() is a performance enhancement.
If you all are interested in that sort of test, I can put it in a patch.
Right now, I have this (below).
Thanks,
Barret
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index c92a47b6d5b1..4c652b85a55b 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -275,4 +275,32 @@ test_expect_success 'blame file with CRLF
core.autocrlf=true' '
grep "A U Thor" actual
'
+test_expect_success 'blame coalesce' '
+ cat >giraffe <<-\EOF &&
+ ABC
+ DEF
+ EOF
+ git add giraffe &&
+ git commit -m "original file" &&
+
+ cat >giraffe <<-\EOF &&
+ ABC
+ XXX
+ DEF
+ EOF
+ git add giraffe &&
+ git commit -m "interior XXX line" &&
+
+ cat >giraffe <<-\EOF &&
+ ABC
+ DEF
+ EOF
+ git add giraffe &&
+ git commit -m "same contents as original" &&
+
+ git blame giraffe &&
+
+ true
+'
+
test_done