summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jim Meyering <jim@meyering.net>2011-05-26 15:58:16 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-26 11:24:24 -0700
commit5dd564895e84eacfc728183fb5a9215665ff59a3 (patch)
tree8909749079c959c79a054a2d9c3e8368924158a6
parentrerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0' (diff)
downloadtgif-5dd564895e84eacfc728183fb5a9215665ff59a3.tar.xz
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>
-rw-r--r--fsck.c2
-rw-r--r--transport.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fsck.c b/fsck.c
index 3d05d4a794..c17a538def 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 0078660611..26d4e5234a 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). */