From: Jim Meyering Date: Thu, 26 May 2011 13:58:16 +0000 (+0200) Subject: remove tests of always-false condition X-Git-Tag: v1.7.5.4~14^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5dd564895e84eacfc728183fb5a9215665ff59a3;p=git.git 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: Jim Meyering Signed-off-by: Junio C Hamano --- diff --git a/fsck.c b/fsck.c index 3d05d4a79..c17a538de 100644 --- a/fsck.c +++ b/fsck.c @@ -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); diff --git a/transport.c b/transport.c index 007866061..26d4e5234 100644 --- a/transport.c +++ b/transport.c @@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs, continue; if (!ref->peer_ref) continue; - if (!ref->new_sha1 || is_null_sha1(ref->new_sha1)) + if (is_null_sha1(ref->new_sha1)) continue; /* Follow symbolic refs (mainly for HEAD). */