Merge branch 'tg/memfixes' into maint
[gitweb.git] / repository.h
index 0a1db9633f7b64f142e2314edae0d80622de8fda..417787f3ef02e871406fa81d1a1bebcdac6e5f13 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef REPOSITORY_H
 #define REPOSITORY_H
 
+struct config_set;
+struct index_state;
+struct submodule_cache;
+
 struct repository {
        /* Environment */
        /*
@@ -39,6 +43,30 @@ struct repository {
         */
        char *worktree;
 
+       /*
+        * Path from the root of the top-level superproject down to this
+        * repository.  This is only non-NULL if the repository is initialized
+        * as a submodule of another repository.
+        */
+       char *submodule_prefix;
+
+       /* Subsystems */
+       /*
+        * Repository's config which contains key-value pairs from the usual
+        * set of config files (i.e. repo specific .git/config, user wide
+        * ~/.gitconfig, XDG config file and the global /etc/gitconfig)
+        */
+       struct config_set *config;
+
+       /* Repository's submodule config as defined by '.gitmodules' */
+       struct submodule_cache *submodule_cache;
+
+       /*
+        * Repository's in-memory index.
+        * 'repo_read_index()' can be used to populate 'index'.
+        */
+       struct index_state *index;
+
        /* Configurations */
        /*
         * Bit used during initialization to indicate if repository state (like
@@ -59,6 +87,11 @@ extern struct repository *the_repository;
 extern void repo_set_gitdir(struct repository *repo, const char *path);
 extern void repo_set_worktree(struct repository *repo, const char *path);
 extern int repo_init(struct repository *repo, const char *gitdir, const char *worktree);
+extern int repo_submodule_init(struct repository *submodule,
+                              struct repository *superproject,
+                              const char *path);
 extern void repo_clear(struct repository *repo);
 
+extern int repo_read_index(struct repository *repo);
+
 #endif /* REPOSITORY_H */