Skip to content

Commit 1c573cd

Browse files
ttaylorrgitster
authored andcommitted
pack-write: pass 'struct packing_data' to 'stage_tmp_packfiles'
This structure will be used to communicate the per-object mtimes when writing a cruft pack. Here, we need the full packing_data structure because the mtime information is stored in an array there, not on the individual object_entry's themselves (to avoid paying the overhead in structure width for operations which do not generate a cruft pack). We haven't passed this information down before because one of the two callers (in bulk-checkin.c) does not have a packing_data structure at all. In that case (where no cruft pack will be generated), NULL is passed instead. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94cd775 commit 1c573cd

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

builtin/pack-objects.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,8 @@ static void write_pack_file(void)
12621262

12631263
stage_tmp_packfiles(&tmpname, pack_tmp_name,
12641264
written_list, nr_written,
1265-
&pack_idx_opts, hash, &idx_tmp_name);
1265+
&to_pack, &pack_idx_opts, hash,
1266+
&idx_tmp_name);
12661267

12671268
if (write_bitmap_index) {
12681269
size_t tmpname_len = tmpname.len;

bulk-checkin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void finish_tmp_packfile(struct strbuf *basename,
3333
char *idx_tmp_name = NULL;
3434

3535
stage_tmp_packfiles(basename, pack_tmp_name, written_list, nr_written,
36-
pack_idx_opts, hash, &idx_tmp_name);
36+
NULL, pack_idx_opts, hash, &idx_tmp_name);
3737
rename_tmp_packfile_idx(basename, &idx_tmp_name);
3838

3939
free(idx_tmp_name);

pack-write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ void stage_tmp_packfiles(struct strbuf *name_buffer,
484484
const char *pack_tmp_name,
485485
struct pack_idx_entry **written_list,
486486
uint32_t nr_written,
487+
struct packing_data *to_pack,
487488
struct pack_idx_option *pack_idx_opts,
488489
unsigned char hash[],
489490
char **idx_tmp_name)

pack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ int encode_in_pack_object_header(unsigned char *hdr, int hdr_len,
109109
#define PH_ERROR_PROTOCOL (-3)
110110
int read_pack_header(int fd, struct pack_header *);
111111

112+
struct packing_data;
113+
112114
struct hashfile *create_tmp_packfile(char **pack_tmp_name);
113115
void stage_tmp_packfiles(struct strbuf *name_buffer,
114116
const char *pack_tmp_name,
115117
struct pack_idx_entry **written_list,
116118
uint32_t nr_written,
119+
struct packing_data *to_pack,
117120
struct pack_idx_option *pack_idx_opts,
118121
unsigned char hash[],
119122
char **idx_tmp_name);

0 commit comments

Comments
 (0)