]> git.ipfire.org Git - thirdparty/git.git/commit - line-log.c
line-log: fix crash when --first-parent is used
authorTzvetan Mikov <tmikov@gmail.com>
Tue, 4 Nov 2014 20:33:37 +0000 (12:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Nov 2014 20:47:35 +0000 (12:47 -0800)
commita8787c5c1c51f4bdb610526175442a23eea7c467
tree3a00579a034a4231109d36ecdfc6432742d22327
parent1762224ddb599ab14ca26cedafec39dee9b92fe5
line-log: fix crash when --first-parent is used

line-log tries to access all parents of a commit, but only the first
parent has been loaded if "--first-parent" is specified, resulting
in a crash.

Limit the number of parents to one if "--first-parent" is specified.

Reported-by: Eric N. Vander Weele <ericvw@gmail.com>
Signed-off-by: Tzvetan Mikov <tmikov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
line-log.c
t/t4211-line-log.sh