diff options
Diffstat (limited to 'packfile.c')
| -rw-r--r-- | packfile.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c index 378b0b1920..9cc11b6dc5 100644 --- a/packfile.c +++ b/packfile.c @@ -900,6 +900,22 @@ struct packed_git *packfile_store_load_pack(struct packfile_store *store, return p; } +int packfile_store_freshen_object(struct packfile_store *store, + const struct object_id *oid) +{ + struct pack_entry e; + if (!find_pack_entry(store->odb->repo, oid, &e)) + return 0; + if (e.p->is_cruft) + return 0; + if (e.p->freshened) + return 1; + if (utime(e.p->pack_name, NULL)) + return 0; + e.p->freshened = 1; + return 1; +} + void (*report_garbage)(unsigned seen_bits, const char *path); static void report_helper(const struct string_list *list, |
