Skip to content

Commit 0717a42

Browse files
committed
Merge branch 'ds/reprepare-alternates-when-repreparing-packfiles'
Once we start running, we assumed that the list of alternate object databases would never change. Hook into the machinery used to update the list of packfiles during runtime to update this list as well. * ds/reprepare-alternates-when-repreparing-packfiles: object-file: reprepare alternates when necessary
2 parents 5c92a45 + e2d003d commit 0717a42

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packfile.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,16 @@ void reprepare_packed_git(struct repository *r)
10101010
struct object_directory *odb;
10111011

10121012
obj_read_lock();
1013+
1014+
/*
1015+
* Reprepare alt odbs, in case the alternates file was modified
1016+
* during the course of this process. This only _adds_ odbs to
1017+
* the linked list, so existing odbs will continue to exist for
1018+
* the lifetime of the process.
1019+
*/
1020+
r->objects->loaded_alternates = 0;
1021+
prepare_alt_odb(r);
1022+
10131023
for (odb = r->objects->odb; odb; odb = odb->next)
10141024
odb_clear_loose_cache(odb);
10151025

0 commit comments

Comments
 (0)