pack-mtimes: support writing pack .mtimes files
Now that the `.mtimes` format is defined, supplement the pack-write API to be able to conditionally write an `.mtimes` file along with a pack by setting an additional flag and passing an oidmap that contains the timestamps corresponding to each object in the pack. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d9fef9d90d
commit
5dfaf49a5a
@ -170,6 +170,9 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
|
||||
if (pdata->layer)
|
||||
REALLOC_ARRAY(pdata->layer, pdata->nr_alloc);
|
||||
|
||||
if (pdata->cruft_mtime)
|
||||
REALLOC_ARRAY(pdata->cruft_mtime, pdata->nr_alloc);
|
||||
}
|
||||
|
||||
new_entry = pdata->objects + pdata->nr_objects++;
|
||||
@ -198,6 +201,9 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
if (pdata->layer)
|
||||
pdata->layer[pdata->nr_objects - 1] = 0;
|
||||
|
||||
if (pdata->cruft_mtime)
|
||||
pdata->cruft_mtime[pdata->nr_objects - 1] = 0;
|
||||
|
||||
return new_entry;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user