diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-04-07 21:03:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-10 20:35:39 +0200 |
commit | 7fd12bfbef015bb63f2376f678d71bca54bbc64d (patch) | |
tree | ead30367ecd200ef6dfb832fd29d936d6c472a65 /http-backend.c | |
parent | check_aliased_update(): check that dst_name is non-NULL (diff) | |
download | git-7fd12bfbef015bb63f2376f678d71bca54bbc64d.tar.xz git-7fd12bfbef015bb63f2376f678d71bca54bbc64d.zip |
show_head_ref(): check the result of resolve_ref_namespace()
Only use the result of resolve_ref_namespace() if it is non-NULL.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
-rw-r--r-- | http-backend.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/http-backend.c b/http-backend.c index 8870a2681e..214881459d 100644 --- a/http-backend.c +++ b/http-backend.c @@ -484,9 +484,9 @@ static int show_head_ref(const char *refname, const struct object_id *oid, const char *target = resolve_ref_unsafe(refname, RESOLVE_REF_READING, unused.hash, NULL); - const char *target_nons = strip_namespace(target); - strbuf_addf(buf, "ref: %s\n", target_nons); + if (target) + strbuf_addf(buf, "ref: %s\n", strip_namespace(target)); } else { strbuf_addf(buf, "%s\n", oid_to_hex(oid)); } |