File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -275,4 +275,40 @@ test_expect_success 'blame file with CRLF core.autocrlf=true' '
275275 grep "A U Thor" actual
276276'
277277
278+ # Tests the splitting and merging of blame entries in blame_coalesce().
279+ # The output of blame is the same, regardless of whether blame_coalesce() runs
280+ # or not, so we'd likely only notice a problem if blame crashes or assigned
281+ # blame to the "splitting" commit ('SPLIT' below).
282+ test_expect_success ' blame coalesce' '
283+ cat >giraffe <<-\EOF &&
284+ ABC
285+ DEF
286+ EOF
287+ git add giraffe &&
288+ git commit -m "original file" &&
289+ oid=$(git rev-parse HEAD) &&
290+
291+ cat >giraffe <<-\EOF &&
292+ ABC
293+ SPLIT
294+ DEF
295+ EOF
296+ git add giraffe &&
297+ git commit -m "interior SPLIT line" &&
298+
299+ cat >giraffe <<-\EOF &&
300+ ABC
301+ DEF
302+ EOF
303+ git add giraffe &&
304+ git commit -m "same contents as original" &&
305+
306+ cat >expect <<-EOF &&
307+ $oid 1) ABC
308+ $oid 2) DEF
309+ EOF
310+ git -c core.abbrev=40 blame -s giraffe >actual &&
311+ test_cmp expect actual
312+ '
313+
278314test_done
You can’t perform that action at this time.
0 commit comments