diff options
Diffstat (limited to 'packfile.c')
| -rw-r--r-- | packfile.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c index 4aee73d545..b120405ccc 100644 --- a/packfile.c +++ b/packfile.c @@ -1,4 +1,8 @@ #include "cache.h" +#include "alloc.h" +#include "environment.h" +#include "gettext.h" +#include "hex.h" #include "list.h" #include "pack.h" #include "repository.h" @@ -17,6 +21,7 @@ #include "midx.h" #include "commit-graph.h" #include "promisor-remote.h" +#include "wrapper.h" char *odb_pack_name(struct strbuf *buf, const unsigned char *hash, @@ -1008,6 +1013,16 @@ void reprepare_packed_git(struct repository *r) struct object_directory *odb; obj_read_lock(); + + /* + * Reprepare alt odbs, in case the alternates file was modified + * during the course of this process. This only _adds_ odbs to + * the linked list, so existing odbs will continue to exist for + * the lifetime of the process. + */ + r->objects->loaded_alternates = 0; + prepare_alt_odb(r); + for (odb = r->objects->odb; odb; odb = odb->next) odb_clear_loose_cache(odb); @@ -2204,8 +2219,8 @@ int for_each_packed_object(each_packed_object_fn cb, void *data, } static int add_promisor_object(const struct object_id *oid, - struct packed_git *pack, - uint32_t pos, + struct packed_git *pack UNUSED, + uint32_t pos UNUSED, void *set_) { struct oidset *set = set_; |
