show-branch: avoid segfault with --reflog of unborn branch
authorJeff King <redacted>
Thu, 24 Sep 2015 21:02:54 +0000 (17:02 -0400)
committerJunio C Hamano <redacted>
Fri, 25 Sep 2015 17:18:18 +0000 (10:18 -0700)
commit7cd17e80579c2bffd6245837175a6e1b12a78045
treea05065010e9c4d15c90c8896b133c5162e45e6dc
parent8d530c4d64ffcc853889f7b385f554d53db375ed
show-branch: avoid segfault with --reflog of unborn branch

When no branch is given to the "--reflog" option, we resolve
HEAD to get the default branch. However, if HEAD points to
an unborn branch, resolve_ref returns NULL, and we later
segfault trying to access it.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/show-branch.c
git clone https://git.99rst.org/PROJECT