aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-11-19 08:51:01 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-25 12:16:00 -0800
commitac65c70663b092e823b0d3de1c1cfdee0a4fbc8e (patch)
tree5a4b721f47d9780439ac20a5410415a0f2c08883 /odb.c
parent2816b748e5c300afda559a09426f8342c235c29d (diff)
downloadgit-ac65c70663b092e823b0d3de1c1cfdee0a4fbc8e.tar.gz
odb: handle recreation of quarantine directories
In the preceding commit we have moved the logic that reparents object database sources on chdir(3p) from "setup.c" into "odb.c". Let's also do the same for any temporary quarantine directories so that the complete reparenting logic is self-contained in "odb.c". Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/odb.c b/odb.c
index 70665fb7f4..dc8f292f3d 100644
--- a/odb.c
+++ b/odb.c
@@ -24,6 +24,7 @@
#include "strbuf.h"
#include "strvec.h"
#include "submodule.h"
+#include "tmp-objdir.h"
#include "trace2.h"
#include "write-or-die.h"
@@ -1041,8 +1042,11 @@ static void odb_update_commondir(const char *name UNUSED,
void *cb_data)
{
struct object_database *odb = cb_data;
+ struct tmp_objdir *tmp_objdir;
struct odb_source *source;
+ tmp_objdir = tmp_objdir_unapply_primary_odb();
+
/*
* In theory, we only have to do this for the primary object source, as
* alternates' paths are always resolved to an absolute path.
@@ -1059,6 +1063,9 @@ static void odb_update_commondir(const char *name UNUSED,
free(source->path);
source->path = path;
}
+
+ if (tmp_objdir)
+ tmp_objdir_reapply_primary_odb(tmp_objdir, old_cwd, new_cwd);
}
struct object_database *odb_new(struct repository *repo,