6 struct submodule_cache
;
11 * Path to the git directory.
12 * Cannot be NULL after initialization.
17 * Path to the common git directory.
18 * Cannot be NULL after initialization.
23 * Path to the repository's object store.
24 * Cannot be NULL after initialization.
29 * Path to the repository's graft file.
30 * Cannot be NULL after initialization.
35 * Path to the current worktree's index file.
36 * Cannot be NULL after initialization.
41 * Path to the working directory.
42 * A NULL value indicates that there is no working directory.
48 * Repository's config which contains key-value pairs from the usual
49 * set of config files (i.e. repo specific .git/config, user wide
50 * ~/.gitconfig, XDG config file and the global /etc/gitconfig)
52 struct config_set
*config
;
54 /* Repository's submodule config as defined by '.gitmodules' */
55 struct submodule_cache
*submodule_cache
;
58 * Repository's in-memory index.
59 * 'repo_read_index()' can be used to populate 'index'.
61 struct index_state
*index
;
65 * Bit used during initialization to indicate if repository state (like
66 * the location of the 'objectdir') should be read from the
67 * environment. By default this bit will be set at the begining of
68 * 'repo_init()' so that all repositories will ignore the environment.
69 * The exception to this is 'the_repository', which doesn't go through
70 * the normal 'repo_init()' process.
72 unsigned ignore_env
:1;
74 /* Indicate if a repository has a different 'commondir' from 'gitdir' */
75 unsigned different_commondir
:1;
78 extern struct repository
*the_repository
;
80 extern void repo_set_gitdir(struct repository
*repo
, const char *path
);
81 extern void repo_set_worktree(struct repository
*repo
, const char *path
);
82 extern int repo_init(struct repository
*repo
, const char *gitdir
, const char *worktree
);
83 extern void repo_clear(struct repository
*repo
);
85 extern int repo_read_index(struct repository
*repo
);
87 #endif /* REPOSITORY_H */