summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d00bda)
raw | patch | inline | side by side (parent: 4d00bda)
author | Nicolas Pitre <nico@cam.org> | |
Fri, 2 Nov 2007 03:43:24 +0000 (23:43 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 2 Nov 2007 08:41:04 +0000 (01:41 -0700) |
... when calling write_idx_file().
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index f4b90c1e4d79501fab9c19a08026153157f89c06..d0ca165c9b683863244dc6d7d71aec4bfad14227 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
* nice "minimum seek" order.
*/
static struct object_entry *objects;
-static struct object_entry **written_list;
+static struct pack_idx_entry **written_list;
static uint32_t nr_objects, nr_alloc, nr_result, nr_written;
static int non_empty;
e->idx.offset = 0;
return 0;
}
- written_list[nr_written++] = e;
+ written_list[nr_written++] = &e->idx;
/* make sure off_t is sufficiently large not to wrap */
if (offset > offset + size)
if (do_progress)
start_progress(&progress_state, "Writing %u objects...", "", nr_result);
- written_list = xmalloc(nr_objects * sizeof(struct object_entry *));
+ written_list = xmalloc(nr_objects * sizeof(*written_list));
do {
unsigned char sha1[20];
umask(mode);
mode = 0444 & ~mode;
- idx_tmp_name = write_idx_file(NULL,
- (struct pack_idx_entry **) written_list, nr_written, sha1);
+ idx_tmp_name = write_idx_file(NULL, written_list,
+ nr_written, sha1);
snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
base_name, sha1_to_hex(sha1));
if (adjust_perm(pack_tmp_name, mode))
/* mark written objects as written to previous pack */
for (j = 0; j < nr_written; j++) {
- written_list[j]->idx.offset = (off_t)-1;
+ written_list[j]->offset = (off_t)-1;
}
nr_remaining -= nr_written;
} while (nr_remaining && i < nr_objects);