aboutsummaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/repository.h b/repository.h
index 5808a5d610..078059a6e0 100644
--- a/repository.h
+++ b/repository.h
@@ -3,6 +3,7 @@
#include "strmap.h"
#include "repo-settings.h"
+#include "environment.h"
struct config_set;
struct git_hash_algo;
@@ -72,6 +73,13 @@ struct repository {
struct ref_store *refs_private;
/*
+ * Disable ref updates. This is especially used in contexts where
+ * transactions may still be rolled back so that we don't start to
+ * reference objects that may vanish.
+ */
+ bool disable_ref_updates;
+
+ /*
* A strmap of ref_stores, stored by submodule name, accessible via
* `repo_get_submodule_ref_store()`.
*/
@@ -141,8 +149,16 @@ struct repository {
/* Repository's compatibility hash algorithm. */
const struct git_hash_algo *compat_hash_algo;
+ /* Repository's config values parsed by git_default_config() */
+ struct repo_config_values config_values_private_;
+
/* Repository's reference storage format, as serialized on disk. */
enum ref_storage_format ref_storage_format;
+ /*
+ * Reference storage information as needed for the backend. This contains
+ * only the payload from the reference URI without the schema.
+ */
+ char *ref_storage_payload;
/* A unique-id for tracing purposes. */
int trace2_repo_id;
@@ -150,6 +166,12 @@ struct repository {
/* True if commit-graph has been disabled within this process. */
int commit_graph_disabled;
+ /*
+ * Lazily-populated cache mapping hook event names to configured hooks.
+ * NULL until first hook use.
+ */
+ struct strmap *hook_config_cache;
+
/* Configurations related to promisor remotes. */
char *repository_format_partial_clone;
struct promisor_remote_config *promisor_remote_config;
@@ -158,12 +180,16 @@ struct repository {
int repository_format_worktree_config;
int repository_format_relative_worktrees;
int repository_format_precious_objects;
+ int repository_format_submodule_path_cfg;
/* Indicate if a repository has a different 'commondir' from 'gitdir' */
unsigned different_commondir:1;
/* Should repo_config() check for deprecated settings */
bool check_deprecated_config;
+
+ /* Has this repository instance been initialized? */
+ bool initialized;
};
#ifdef USE_THE_REPOSITORY_VARIABLE
@@ -187,16 +213,18 @@ struct set_gitdir_args {
const char *graft_file;
const char *index_file;
const char *alternate_db;
- int disable_ref_updates;
+ bool disable_ref_updates;
+ bool skip_initializing_odb;
};
void repo_set_gitdir(struct repository *repo, const char *root,
const struct set_gitdir_args *extra_args);
void repo_set_worktree(struct repository *repo, const char *path);
-void repo_set_hash_algo(struct repository *repo, int algo);
-void repo_set_compat_hash_algo(struct repository *repo, int compat_algo);
+void repo_set_hash_algo(struct repository *repo, uint32_t algo);
+void repo_set_compat_hash_algo(struct repository *repo, uint32_t compat_algo);
void repo_set_ref_storage_format(struct repository *repo,
- enum ref_storage_format format);
+ enum ref_storage_format format,
+ const char *payload);
void initialize_repository(struct repository *repo);
RESULT_MUST_BE_USED
int repo_init(struct repository *r, const char *gitdir, const char *worktree);