From: Junio C Hamano Date: Tue, 24 Mar 2009 22:31:21 +0000 (-0700) Subject: Merge branch 'maint-1.6.1' into maint X-Git-Tag: v1.6.2.2~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b0de55541024a39ece47cf7a1eebdbde08ba978f?hp=cbc8c6104199ffa63b61f4e8dee32d3a713e2939 Merge branch 'maint-1.6.1' into maint * maint-1.6.1: close_sha1_file(): make it easier to diagnose errors avoid possible overflow in delta size filtering computation --- diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index bcefa52c69..8ca46c8deb 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1293,7 +1293,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src, max_size = trg_entry->delta_size; ref_depth = trg->depth; } - max_size = max_size * (max_depth - src->depth) / + max_size = (uint64_t)max_size * (max_depth - src->depth) / (max_depth - ref_depth + 1); if (max_size == 0) return 0; diff --git a/sha1_file.c b/sha1_file.c index 032300c4c6..a07aa4e5c4 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2301,7 +2301,7 @@ static void close_sha1_file(int fd) fsync_or_die(fd, "sha1 file"); fchmod(fd, 0444); if (close(fd) != 0) - die("unable to write sha1 file"); + die("error when closing sha1 file (%s)", strerror(errno)); } /* Size of directory component, including the ending '/' */