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 <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jim Meyering committed
May 26, 2011 at 15:58 UTC
5dd564895e84eacfc728183fb5a9215665ff59a3
2 files changed
+2
-2
fsck.c
+1
-1
@@ -350,7 +350,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
350
int len;
351
struct strbuf sb = STRBUF_INIT;
352
353
- strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)");
353
+ strbuf_addf(&sb, "object %s:", sha1_to_hex(obj->sha1));
354
355
va_start(ap, fmt);
356
len = vsnprintf(sb.buf + sb.len, strbuf_avail(&sb), fmt, ap);
transport.c
+1
-1
@@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
156
continue;
157
if (!ref->peer_ref)
158
continue;
159
- if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
159
+ if (is_null_sha1(ref->new_sha1))
160
continue;
161
162
/* Follow symbolic refs (mainly for HEAD). */