зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
ded8393610
Коммит
7fd12bfbef
|
@ -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));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче