From 9af270e8c2a02afd9a3262a2c9312ee7fefbb7a3 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 21 Dec 2013 09:13:25 -0500 Subject: do not pretend sha1write returns errors The sha1write function returns an int, but it will always be "0". The failure-prone parts of the function happen in the "flush" callback, which cannot pass an error back to us. So we just end up calling die() during the flush. Let's just drop the return value altogether, as it only confuses callers into thinking that it might be useful. Only one call site actually checked the return value. We can drop that check, since it just led to a die() anyway. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- pack-write.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pack-write.c') diff --git a/pack-write.c b/pack-write.c index ca9e63be18..676ed4ce9a 100644 --- a/pack-write.c +++ b/pack-write.c @@ -189,8 +189,7 @@ off_t write_pack_header(struct sha1file *f, uint32_t nr_entries) hdr.hdr_signature = htonl(PACK_SIGNATURE); hdr.hdr_version = htonl(PACK_VERSION); hdr.hdr_entries = htonl(nr_entries); - if (sha1write(f, &hdr, sizeof(hdr))) - return 0; + sha1write(f, &hdr, sizeof(hdr)); return sizeof(hdr); } -- cgit v1.3