aboutsummaryrefslogtreecommitdiffstats
path: root/repository.h
diff options
context:
space:
mode:
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/repository.h b/repository.h
index 268436779c..a35cd77c35 100644
--- a/repository.h
+++ b/repository.h
@@ -1,6 +1,9 @@
#ifndef REPOSITORY_H
#define REPOSITORY_H
+#include "refs.h"
+#include "strmap.h"
+
struct config_set;
struct fsmonitor_settings;
struct git_hash_algo;
@@ -24,10 +27,6 @@ enum fetch_negotiation_setting {
FETCH_NEGOTIATION_NOOP,
};
-#define REF_STORAGE_FORMAT_UNKNOWN 0
-#define REF_STORAGE_FORMAT_FILES 1
-#define REF_STORAGE_FORMAT_REFTABLE 2
-
struct repo_settings {
int initialized;
@@ -109,6 +108,18 @@ struct repository {
struct ref_store *refs_private;
/*
+ * A strmap of ref_stores, stored by submodule name, accessible via
+ * `repo_get_submodule_ref_store()`.
+ */
+ struct strmap submodule_ref_stores;
+
+ /*
+ * A strmap of ref_stores, stored by worktree id, accessible via
+ * `get_worktree_ref_store()`.
+ */
+ struct strmap worktree_ref_stores;
+
+ /*
* Contains path to often used file names.
*/
struct repo_path_cache cached_paths;
@@ -167,7 +178,7 @@ struct repository {
const struct git_hash_algo *compat_hash_algo;
/* Repository's reference storage format, as serialized on disk. */
- unsigned int ref_storage_format;
+ enum ref_storage_format ref_storage_format;
/* A unique-id for tracing purposes. */
int trace2_repo_id;
@@ -187,9 +198,6 @@ struct repository {
};
extern struct repository *the_repository;
-#ifdef USE_THE_INDEX_VARIABLE
-extern struct index_state the_index;
-#endif
/*
* Define a custom repository layout. Any field can be NULL, which
@@ -209,8 +217,9 @@ void repo_set_gitdir(struct repository *repo, const char *root,
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_ref_storage_format(struct repository *repo, unsigned int format);
-void initialize_the_repository(void);
+void repo_set_ref_storage_format(struct repository *repo,
+ enum ref_storage_format format);
+void initialize_repository(struct repository *repo);
RESULT_MUST_BE_USED
int repo_init(struct repository *r, const char *gitdir, const char *worktree);