1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
#define GIT_REPOSITORY_INIT_OPTIONS_VERSION ...
void git_repository_free(git_repository *repo);
int git_repository_state_cleanup(git_repository *repo);
int git_repository_config(git_config **out, git_repository *repo);
int git_repository_config_snapshot(git_config **out, git_repository *repo);
typedef enum {
GIT_REPOSITORY_INIT_BARE = 1,
GIT_REPOSITORY_INIT_NO_REINIT = 2,
GIT_REPOSITORY_INIT_NO_DOTGIT_DIR = 4,
GIT_REPOSITORY_INIT_MKDIR = 8,
GIT_REPOSITORY_INIT_MKPATH = 16,
GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE = 32,
GIT_REPOSITORY_INIT_RELATIVE_GITLINK = 64,
} git_repository_init_flag_t;
typedef enum {
GIT_REPOSITORY_INIT_SHARED_UMASK = 0,
GIT_REPOSITORY_INIT_SHARED_GROUP = 0002775,
GIT_REPOSITORY_INIT_SHARED_ALL = 0002777,
} git_repository_init_mode_t;
typedef enum {
GIT_REPOSITORY_STATE_NONE,
GIT_REPOSITORY_STATE_MERGE,
GIT_REPOSITORY_STATE_REVERT,
GIT_REPOSITORY_STATE_REVERT_SEQUENCE,
GIT_REPOSITORY_STATE_CHERRYPICK,
GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE,
GIT_REPOSITORY_STATE_BISECT,
GIT_REPOSITORY_STATE_REBASE,
GIT_REPOSITORY_STATE_REBASE_INTERACTIVE,
GIT_REPOSITORY_STATE_REBASE_MERGE,
GIT_REPOSITORY_STATE_APPLY_MAILBOX,
GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE
} git_repository_state_t;
typedef struct {
unsigned int version;
uint32_t flags;
uint32_t mode;
const char *workdir_path;
const char *description;
const char *template_path;
const char *initial_head;
const char *origin_url;
} git_repository_init_options;
int git_repository_init_options_init(
git_repository_init_options *opts,
unsigned int version);
int git_repository_init(
git_repository **out,
const char *path,
unsigned is_bare);
int git_repository_init_ext(
git_repository **out,
const char *repo_path,
git_repository_init_options *opts);
typedef enum {
GIT_REPOSITORY_OPEN_NO_SEARCH = 1,
GIT_REPOSITORY_OPEN_CROSS_FS = 2,
GIT_REPOSITORY_OPEN_BARE = 4,
GIT_REPOSITORY_OPEN_NO_DOTGIT = 8,
GIT_REPOSITORY_OPEN_FROM_ENV = 16,
} git_repository_open_flag_t;
int git_repository_open_ext(
git_repository **out,
const char *path,
unsigned int flags,
const char *ceiling_dirs);
int git_repository_set_head(
git_repository* repo,
const char* refname);
int git_repository_set_head_detached(
git_repository* repo,
const git_oid* committish);
int git_repository_hashfile(git_oid *out, git_repository *repo, const char *path, git_object_t type, const char *as_path);
int git_repository_ident(const char **name, const char **email, const git_repository *repo);
int git_repository_set_ident(git_repository *repo, const char *name, const char *email);
int git_repository_index(git_index **out, git_repository *repo);
git_repository_state_t git_repository_state(git_repository *repo);
int git_repository_message(git_buf *out, git_repository *repo);
int git_repository_message_remove(git_repository *repo);
int git_repository_submodule_cache_all(git_repository *repo);
int git_repository_submodule_cache_clear(git_repository *repo);
|