diff options
author | Neeraj Singh <neerajsi@microsoft.com> | 2021-12-06 23:05:05 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-08 23:06:46 +0100 |
commit | ecd81dfc79cf12cc21fc0340da8ca8fcc5aa58a7 (patch) | |
tree | c9e99733796f9a1004ddf6997075423716a4b202 /repository.h | |
parent | tmp-objdir: new API for creating temporary writable databases (diff) | |
download | git-ecd81dfc79cf12cc21fc0340da8ca8fcc5aa58a7.tar.xz git-ecd81dfc79cf12cc21fc0340da8ca8fcc5aa58a7.zip |
tmp-objdir: disable ref updates when replacing the primary odb
When creating a subprocess with a temporary ODB, we set the
GIT_QUARANTINE_ENVIRONMENT env var to tell child Git processes not
to update refs, since the tmp-objdir may go away.
Introduce a similar mechanism for in-process temporary ODBs when
we call tmp_objdir_replace_primary_odb. Now both mechanisms set
the disable_ref_updates flag on the odb, which is queried by
the ref_transaction_prepare function.
Peff's test case [1] was invoking ref updates via the cachetextconv
setting. That particular code silently does nothing when a ref
update is forbidden. See the call to notes_cache_put in
fill_textconv where errors are ignored.
[1] https://lore.kernel.org/git/YVOn3hDsb5pnxR53@coredump.intra.peff.net/
Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Neeraj Singh <neerajsi@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
-rw-r--r-- | repository.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/repository.h b/repository.h index 3740c93bc0..77316367d9 100644 --- a/repository.h +++ b/repository.h @@ -162,6 +162,7 @@ struct set_gitdir_args { const char *graft_file; const char *index_file; const char *alternate_db; + int disable_ref_updates; }; void repo_set_gitdir(struct repository *repo, const char *root, |