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:
authorJunio C Hamano <gitster@pobox.com>2023-03-20 01:03:12 +0300
committerJunio C Hamano <gitster@pobox.com>2023-03-20 01:03:12 +0300
commit0717a424a723201c4b77da3638764c70819c3f63 (patch)
tree88c5542684465982e380ad07e180705ac749d2d5
parent5c92a451be8050576aa271a82b00727278dc4642 (diff)
parente2d003dbedf05906c0cc22493a96124c94521973 (diff)
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
-rw-r--r--packfile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c
index fc2d7c2190..2023df1b75 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1010,6 +1010,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);