aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http-backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/http-backend.c b/http-backend.c
index 8870a2681..214881459 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));
}