aboutsummaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-15 12:04:52 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-15 12:04:52 +0900
commit9fbcb51ec548318f0088a5fee6c77a5f1d8512b4 (patch)
tree548dfa2d249d03ddb7bec8653d8e596727bf94ae /log-tree.c
parentbb2c9262a5eff9e4d6ddca23f6e0787afbd7b091 (diff)
parentdbd2b55cb7b06e94096b8c18852a94732e3f76a8 (diff)
downloadgit-9fbcb51ec548318f0088a5fee6c77a5f1d8512b4.tar.gz
git-9fbcb51ec548318f0088a5fee6c77a5f1d8512b4.tar.xz
Merge branch 'jk/misc-resolve-ref-unsafe-fixes' into maint
Some codepaths did not check for errors when asking what branch the HEAD points at, which have been fixed. * jk/misc-resolve-ref-unsafe-fixes: worktree: handle broken symrefs in find_shared_symref() log: handle broken HEAD in decoration check remote: handle broken symrefs test-ref-store: avoid passing NULL to printf
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c
index cea056234..580b3a98a 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -198,7 +198,7 @@ static const struct name_decoration *current_pointed_by_HEAD(const struct name_d
/* Now resolve and find the matching current branch */
branch_name = resolve_ref_unsafe("HEAD", 0, NULL, &rru_flags);
- if (!(rru_flags & REF_ISSYMREF))
+ if (!branch_name || !(rru_flags & REF_ISSYMREF))
return NULL;
if (!starts_with(branch_name, "refs/"))