Merge branch 'maint-1.6.0' into maint-1.6.1
authorJunio C Hamano <gitster@pobox.com>
Tue, 24 Mar 2009 22:31:15 +0000 (15:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Mar 2009 22:31:15 +0000 (15:31 -0700)
* maint-1.6.0:
close_sha1_file(): make it easier to diagnose errors
avoid possible overflow in delta size filtering computation

builtin-pack-objects.c
sha1_file.c
index 7079fab7db808438b8b2bdf79ff693127610dfd3..7234d76f6e7c0ca59964ec06bf3ced7196716749 100644 (file)
@@ -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;
index b63f842cbdaf01e8a3b0ba35cbfc1ad0cbac6913..3d93d936e4e3ddf24f46af2ef92e62e5f7db3877 100644 (file)
@@ -2298,7 +2298,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 '/' */