mirror of
https://github.com/git/git.git
synced 2026-03-20 13:40:08 +01:00
The parent rewriting code of 'git log -L' was too aggressive in freeing memory: assign_range_to_parent() will free the commit->parents field when it sees that a parent cannot pass off any blame (is a root commit in rewritten history). Its caller assign_parents_range() however will, upon finding the first parent that takes *full* blame for all ranges, rewind and reinstate all previous parents' line ranges and parent lists. This resurrects pointers to ranges that were freed in assign_range_to_parent() under some circumstances. Furthermore, we must not empty the parent lists either: the same rewind/reinstate code relies on them. Do both only if the commit was an ordinary (not merge or root) commit, in which case the merge code-path discussed here is never taken. Reported-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
37 KiB
37 KiB