Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-05-21 02:17:43 +0300
committerJunio C Hamano <gitster@pobox.com>2022-05-27 01:48:26 +0300
commit5dfaf49a5a651d3e8c3552bc2e833312a3671a4f (patch)
treef87f12552c923b46de589e26a70e7fc67502aed7 /pack-objects.c
parentd9fef9d90d27b6794350ec3bc622042b79397088 (diff)
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>
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pack-objects.c b/pack-objects.c
index fe2a4eace9..272e8d4517 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -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;
}