Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
show_head_ref(): check the result of resolve_ref_namespace()
author
Michael Haggerty
<mhagger@alum.mit.edu>
Thu, 7 Apr 2016 19:03:09 +0000
(15:03 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 10 Apr 2016 18:35:39 +0000
(11:35 -0700)
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>
http-backend.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
ded8393
)
diff --git
a/http-backend.c
b/http-backend.c
index 8870a2681eb375505e4273b03a0d3e034e59a48e..214881459d828101fa0927321c5a8facb3a540f0 100644
(file)
--- 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));
}