aboutsummaryrefslogtreecommitdiff
path: root/builtin/remote.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 /builtin/remote.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 'builtin/remote.c')
-rw-r--r--builtin/remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 4f5cac96b..bc8962369 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -565,7 +565,7 @@ static int read_remote_branches(const char *refname,
item = string_list_append(rename->remote_branches, xstrdup(refname));
symref = resolve_ref_unsafe(refname, RESOLVE_REF_READING,
NULL, &flag);
- if (flag & REF_ISSYMREF)
+ if (symref && (flag & REF_ISSYMREF))
item->util = xstrdup(symref);
else
item->util = NULL;