Commit 5dd56489 authored by Jim Meyering's avatar Jim Meyering Committed by Junio C Hamano

remove tests of always-false condition

* fsck.c (fsck_error_function): Don't test obj->sha1 == 0.
It can never be true, since that sha1 member is an array.
* transport.c (set_upstreams): Likewise for ref->new_sha1.
Signed-off-by: default avatarJim Meyering <>
Signed-off-by: default avatarJunio C Hamano <>
parent 5743350f
......@@ -350,7 +350,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
int len;
struct strbuf sb = STRBUF_INIT;
strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)");
strbuf_addf(&sb, "object %s:", sha1_to_hex(obj->sha1));
va_start(ap, fmt);
len = vsnprintf(sb.buf + sb.len, strbuf_avail(&sb), fmt, ap);
......@@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
if (!ref->peer_ref)
if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
if (is_null_sha1(ref->new_sha1))
/* Follow symbolic refs (mainly for HEAD). */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment