builtin/apply: move 'unsafe_paths' global into 'struct apply_state'
[gitweb.git] / http-backend.c
index bac40ef6e6e3566a0ceda81303a6ebb769ac520d..214881459d828101fa0927321c5a8facb3a540f0 100644 (file)
@@ -436,7 +436,7 @@ static int show_text_ref(const char *name, const struct object_id *oid,
                o = deref_tag(o, name, 0);
                if (!o)
                        return 0;
-               strbuf_addf(buf, "%s\t%s^{}\n", sha1_to_hex(o->sha1),
+               strbuf_addf(buf, "%s\t%s^{}\n", oid_to_hex(&o->oid),
                            name_nons);
        }
        return 0;
@@ -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));
        }