]> git.ipfire.org Git - thirdparty/git.git/commit - tree.c
tree: simplify parse_tree_indirect()
authorRené Scharfe <l.s.r@web.de>
Thu, 29 Aug 2019 19:06:22 +0000 (21:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Sep 2019 22:10:53 +0000 (15:10 -0700)
commit1577dc0f7c1326ce59e1e97fad8a0b1e8c826203
tree3902021af0fa77ff2a87fd1cbaa1c68a45211c82
parent745f6812895b31c02b29bdfe4ae8e5498f776c26
tree: simplify parse_tree_indirect()

Reduce code duplication by turning parse_tree_indirect() into a wrapper
of repo_peel_to_type().  This avoids a segfault when handling a broken
tag where ->tagged is NULL.  The new version also checks the return
value of parse_object() that was ignored by the old one.

Initial-patch-by: Stefan Sperling <stsp@stsp.name>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree.c