sha1-file.c: mark more strings for translation
[gitweb.git] / repository.h
index e7127baffba019812e458477a34a4d9a80a67cdc..dba3ddbfdd2d48068d60100425d1a22025cd25b0 100644 (file)
@@ -2,9 +2,10 @@
 #define REPOSITORY_H
 
 struct config_set;
+struct git_hash_algo;
 struct index_state;
+struct raw_object_store;
 struct submodule_cache;
-struct git_hash_algo;
 
 struct repository {
        /* Environment */
@@ -21,13 +22,21 @@ struct repository {
        char *commondir;
 
        /*
-        * Path to the repository's object store.
-        * Cannot be NULL after initialization.
+        * Holds any information related to accessing the raw object content.
+        */
+       struct raw_object_store *objects;
+
+       /*
+        * All objects in this repository that have been parsed. This structure
+        * owns all objects it references, so users of "struct object *"
+        * generally do not need to free them; instead, when a repository is no
+        * longer used, call parsed_object_pool_clear() on this structure, which
+        * is called by the repositories repo_clear on its desconstruction.
         */
-       char *objectdir;
+       struct parsed_object_pool *parsed_objects;
 
-       /* Path to extra alternate object database if not NULL */
-       char *alternate_db;
+       /* The store in which the refs are held. */
+       struct ref_store *refs;
 
        /*
         * Path to the repository's graft file.
@@ -82,6 +91,10 @@ struct repository {
 
 extern struct repository *the_repository;
 
+/*
+ * Define a custom repository layout. Any field can be NULL, which
+ * will default back to the path according to the default layout.
+ */
 struct set_gitdir_args {
        const char *commondir;
        const char *object_dir;
@@ -92,10 +105,13 @@ struct set_gitdir_args {
 
 extern void repo_set_gitdir(struct repository *repo,
                            const char *root,
-                           const struct set_gitdir_args *optional);
+                           const struct set_gitdir_args *extra_args);
 extern void repo_set_worktree(struct repository *repo, const char *path);
 extern void repo_set_hash_algo(struct repository *repo, int algo);
 extern void initialize_the_repository(void);
+extern int repo_init(struct repository *r,
+                    const char *gitdir,
+                    const char *worktree);
 extern int repo_submodule_init(struct repository *submodule,
                               struct repository *superproject,
                               const char *path);