]> git.proxmox.com Git - libgit2.git/blame - include/git2/repository.h
Make git_odb_foreach_cb take const param
[libgit2.git] / include / git2 / repository.h
CommitLineData
f5918330 1/*
5e0de328 2 * Copyright (C) 2009-2012 the libgit2 contributors
f5918330 3 *
bb742ede
VM
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
f5918330 6 */
3315782c
VM
7#ifndef INCLUDE_git_repository_h__
8#define INCLUDE_git_repository_h__
9
10#include "common.h"
d12299fe
VM
11#include "types.h"
12#include "oid.h"
3315782c
VM
13
14/**
f5918330 15 * @file git2/repository.h
d12299fe
VM
16 * @brief Git repository management routines
17 * @defgroup git_repository Git repository management routines
3315782c
VM
18 * @ingroup Git
19 * @{
20 */
21GIT_BEGIN_DECL
22
23/**
6fd195d7 24 * Open a git repository.
3315782c 25 *
9462c471
VM
26 * The 'path' argument must point to either a git repository
27 * folder, or an existing work dir.
3315782c 28 *
9462c471
VM
29 * The method will automatically detect if 'path' is a normal
30 * or bare repository or fail is 'path' is neither.
6fd195d7 31 *
c9fc4a6f 32 * @param out pointer to the repo which will be opened
6fd195d7 33 * @param path the path to the repository
e172cf08 34 * @return 0 or an error code
3315782c 35 */
c9fc4a6f 36GIT_EXTERN(int) git_repository_open(git_repository **out, const char *path);
3315782c 37
6782245e
CMN
38/**
39 * Create a "fake" repository to wrap an object database
40 *
41 * Create a repository object to wrap an object database to be used
42 * with the API when all you have is an object database. This doesn't
43 * have any paths associated with it, so use with care.
44 *
c9fc4a6f 45 * @param out pointer to the repo
6782245e
CMN
46 * @param odb the object database to wrap
47 * @return 0 or an error code
48 */
c9fc4a6f 49GIT_EXTERN(int) git_repository_wrap_odb(git_repository **out, git_odb *odb);
6782245e 50
fd0574e5 51/**
9462c471
VM
52 * Look for a git repository and copy its path in the given buffer.
53 * The lookup start from base_path and walk across parent directories
54 * if nothing has been found. The lookup ends when the first repository
55 * is found, or when reaching a directory referenced in ceiling_dirs
56 * or when the filesystem changes (in case across_fs is true).
fd0574e5 57 *
9462c471
VM
58 * The method will automatically detect if the repository is bare
59 * (if there is a repository).
fd0574e5 60 *
c9fc4a6f 61 * @param path_out The user allocated buffer which will
9462c471 62 * contain the found path.
fd0574e5 63 *
c9fc4a6f 64 * @param path_size repository_path size
fd0574e5
RG
65 *
66 * @param start_path The base path where the lookup starts.
67 *
9462c471
VM
68 * @param across_fs If true, then the lookup will not stop when a
69 * filesystem device change is detected while exploring parent directories.
fd0574e5 70 *
9462c471
VM
71 * @param ceiling_dirs A GIT_PATH_LIST_SEPARATOR separated list of
72 * absolute symbolic link free paths. The lookup will stop when any
73 * of this paths is reached. Note that the lookup always performs on
74 * start_path no matter start_path appears in ceiling_dirs ceiling_dirs
75 * might be NULL (which is equivalent to an empty string)
fd0574e5 76 *
e172cf08 77 * @return 0 or an error code
fd0574e5 78 */
9462c471 79GIT_EXTERN(int) git_repository_discover(
c9fc4a6f
BS
80 char *path_out,
81 size_t path_size,
9462c471
VM
82 const char *start_path,
83 int across_fs,
84 const char *ceiling_dirs);
6fd195d7 85
662880ca
RB
86/**
87 * Option flags for `git_repository_open_ext`.
88 *
89 * * GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be
90 * immediately found in the start_path. Do not walk up from the
91 * start_path looking at parent directories.
ca1b6e54
RB
92 * * GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not
93 * continue searching across filesystem boundaries (i.e. when `st_dev`
94 * changes from the `stat` system call). (E.g. Searching in a user's home
95 * directory "/home/user/source/" will not return "/.git/" as the found
96 * repo if "/" is a different filesystem than "/home".)
662880ca 97 */
c9fc4a6f 98typedef enum {
7784bcbb
RB
99 GIT_REPOSITORY_OPEN_NO_SEARCH = (1 << 0),
100 GIT_REPOSITORY_OPEN_CROSS_FS = (1 << 1),
f4a62c30 101} git_repository_open_flag_t;
7784bcbb
RB
102
103/**
104 * Find and open a repository with extended controls.
662880ca 105 *
c9fc4a6f 106 * @param out Pointer to the repo which will be opened. This can
662880ca
RB
107 * actually be NULL if you only want to use the error code to
108 * see if a repo at this path could be opened.
c9fc4a6f 109 * @param path Path to open as git repository. If the flags
662880ca
RB
110 * permit "searching", then this can be a path to a subdirectory
111 * inside the working directory of the repository.
112 * @param flags A combination of the GIT_REPOSITORY_OPEN flags above.
113 * @param ceiling_dirs A GIT_PATH_LIST_SEPARATOR delimited list of path
114 * prefixes at which the search for a containing repository should
115 * terminate.
116 * @return 0 on success, GIT_ENOTFOUND if no repository could be found,
117 * or -1 if there was a repository but open failed for some reason
118 * (such as repo corruption or system errors).
7784bcbb
RB
119 */
120GIT_EXTERN(int) git_repository_open_ext(
c9fc4a6f
BS
121 git_repository **out,
122 const char *path,
123 unsigned int flags,
7784bcbb
RB
124 const char *ceiling_dirs);
125
3315782c
VM
126/**
127 * Free a previously allocated repository
6b2a1941 128 *
f0d08b7c
VM
129 * Note that after a repository is free'd, all the objects it has spawned
130 * will still exist until they are manually closed by the user
45e79e37 131 * with `git_object_free`, but accessing any of the attributes of
f0d08b7c
VM
132 * an object without a backing repository will result in undefined
133 * behavior
134 *
3315782c
VM
135 * @param repo repository handle to close. If NULL nothing occurs.
136 */
137GIT_EXTERN(void) git_repository_free(git_repository *repo);
138
e1f8cad0 139/**
40c44d2f 140 * Creates a new Git repository in the given folder.
e1f8cad0 141 *
40c44d2f
VM
142 * TODO:
143 * - Reinit the repository
e1f8cad0 144 *
c9fc4a6f 145 * @param out pointer to the repo which will be created or reinitialized
e1f8cad0 146 * @param path the path to the repository
662880ca
RB
147 * @param is_bare if true, a Git repository without a working directory is
148 * created at the pointed path. If false, provided path will be
149 * considered as the working directory into which the .git directory
150 * will be created.
40c44d2f 151 *
e172cf08 152 * @return 0 or an error code
e1f8cad0 153 */
662880ca 154GIT_EXTERN(int) git_repository_init(
c9fc4a6f 155 git_repository **out,
662880ca
RB
156 const char *path,
157 unsigned is_bare);
158
159/**
160 * Option flags for `git_repository_init_ext`.
161 *
162 * These flags configure extra behaviors to `git_repository_init_ext`.
163 * In every case, the default behavior is the zero value (i.e. flag is
164 * not set). Just OR the flag values together for the `flags` parameter
165 * when initializing a new repo. Details of individual values are:
166 *
167 * * BARE - Create a bare repository with no working directory.
168 * * NO_REINIT - Return an EEXISTS error if the repo_path appears to
169 * already be an git repository.
170 * * NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo
171 * path for non-bare repos (if it is not already there), but
172 * passing this flag prevents that behavior.
173 * * MKDIR - Make the repo_path (and workdir_path) as needed. Init is
174 * always willing to create the ".git" directory even without this
175 * flag. This flag tells init to create the trailing component of
176 * the repo and workdir paths as needed.
177 * * MKPATH - Recursively make all components of the repo and workdir
178 * paths as necessary.
179 * * EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to
180 * initialize a new repo. This flags enables external templates,
181 * looking the "template_path" from the options if set, or the
182 * `init.templatedir` global config if not, or falling back on
183 * "/usr/share/git-core/templates" if it exists.
662880ca 184 */
f4a62c30 185typedef enum {
662880ca
RB
186 GIT_REPOSITORY_INIT_BARE = (1u << 0),
187 GIT_REPOSITORY_INIT_NO_REINIT = (1u << 1),
188 GIT_REPOSITORY_INIT_NO_DOTGIT_DIR = (1u << 2),
189 GIT_REPOSITORY_INIT_MKDIR = (1u << 3),
190 GIT_REPOSITORY_INIT_MKPATH = (1u << 4),
191 GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE = (1u << 5),
f4a62c30 192} git_repository_init_flag_t;
ca1b6e54
RB
193
194/**
195 * Mode options for `git_repository_init_ext`.
196 *
197 * Set the mode field of the `git_repository_init_options` structure
198 * either to the custom mode that you would like, or to one of the
199 * following modes:
200 *
201 * * SHARED_UMASK - Use permissions configured by umask - the default.
202 * * SHARED_GROUP - Use "--shared=group" behavior, chmod'ing the new repo
203 * to be group writable and "g+sx" for sticky group assignment.
204 * * SHARED_ALL - Use "--shared=all" behavior, adding world readability.
205 * * Anything else - Set to custom value.
206 */
f4a62c30 207typedef enum {
ca1b6e54
RB
208 GIT_REPOSITORY_INIT_SHARED_UMASK = 0,
209 GIT_REPOSITORY_INIT_SHARED_GROUP = 0002775,
210 GIT_REPOSITORY_INIT_SHARED_ALL = 0002777,
f4a62c30 211} git_repository_init_mode_t;
662880ca
RB
212
213/**
214 * Extended options structure for `git_repository_init_ext`.
215 *
216 * This contains extra options for `git_repository_init_ext` that enable
217 * additional initialization features. The fields are:
218 *
219 * * flags - Combination of GIT_REPOSITORY_INIT flags above.
ca1b6e54
RB
220 * * mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_...
221 * constants above, or to a custom value that you would like.
662880ca 222 * * workdir_path - The path to the working dir or NULL for default (i.e.
ca1b6e54
RB
223 * repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH,
224 * IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not
225 * the "natural" working directory, a .git gitlink file will be
226 * created here linking to the repo_path.
662880ca
RB
227 * * description - If set, this will be used to initialize the "description"
228 * file in the repository, instead of using the template content.
229 * * template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set,
230 * this contains the path to use for the template directory. If
231 * this is NULL, the config or default directory options will be
232 * used instead.
233 * * initial_head - The name of the head to point HEAD at. If NULL, then
234 * this will be treated as "master" and the HEAD ref will be set
235 * to "refs/heads/master". If this begins with "refs/" it will be
236 * used verbatim; otherwise "refs/heads/" will be prefixed.
237 * * origin_url - If this is non-NULL, then after the rest of the
238 * repository initialization is completed, an "origin" remote
239 * will be added pointing to this URL.
240 */
c9fc4a6f 241typedef struct git_repository_init_options {
662880ca
RB
242 uint32_t flags;
243 uint32_t mode;
244 const char *workdir_path;
245 const char *description;
246 const char *template_path;
247 const char *initial_head;
248 const char *origin_url;
249} git_repository_init_options;
250
251/**
252 * Create a new Git repository in the given folder with extended controls.
253 *
254 * This will initialize a new git repository (creating the repo_path
255 * if requested by flags) and working directory as needed. It will
256 * auto-detect the case sensitivity of the file system and if the
257 * file system supports file mode bits correctly.
258 *
c9fc4a6f 259 * @param out Pointer to the repo which will be created or reinitialized.
662880ca
RB
260 * @param repo_path The path to the repository.
261 * @param opts Pointer to git_repository_init_options struct.
262 * @return 0 or an error code on failure.
263 */
264GIT_EXTERN(int) git_repository_init_ext(
c9fc4a6f 265 git_repository **out,
662880ca
RB
266 const char *repo_path,
267 git_repository_init_options *opts);
4b8e27c8 268
3601c4bf 269/**
270 * Retrieve and resolve the reference pointed at by HEAD.
271 *
c9fc4a6f 272 * @param out pointer to the reference which will be retrieved
3601c4bf 273 * @param repo a repository object
274 *
8b05bea8 275 * @return 0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing
b1a3a70e 276 * branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise
3601c4bf 277 */
c9fc4a6f 278GIT_EXTERN(int) git_repository_head(git_reference **out, git_repository *repo);
3601c4bf 279
35502d2e
CMN
280/**
281 * Check if a repository's HEAD is detached
282 *
283 * A repository's HEAD is detached when it points directly to a commit
284 * instead of a branch.
285 *
286 * @param repo Repo to test
d73c94b2 287 * @return 1 if HEAD is detached, 0 if it's not; error code if there
35502d2e
CMN
288 * was an error.
289 */
408d733b 290GIT_EXTERN(int) git_repository_head_detached(git_repository *repo);
35502d2e
CMN
291
292/**
293 * Check if the current branch is an orphan
294 *
295 * An orphan branch is one named from HEAD but which doesn't exist in
296 * the refs namespace, because it doesn't have any commit to point to.
297 *
298 * @param repo Repo to test
299 * @return 1 if the current branch is an orphan, 0 if it's not; error
d73c94b2 300 * code if there was an error
35502d2e 301 */
408d733b 302GIT_EXTERN(int) git_repository_head_orphan(git_repository *repo);
35502d2e 303
41233c40
VM
304/**
305 * Check if a repository is empty
306 *
307 * An empty repository has just been initialized and contains
6091457e 308 * no references.
41233c40
VM
309 *
310 * @param repo Repo to test
311 * @return 1 if the repository is empty, 0 if it isn't, error code
312 * if the repository is corrupted
313 */
314GIT_EXTERN(int) git_repository_is_empty(git_repository *repo);
315
6632c155
VM
316/**
317 * Get the path of this repository
318 *
319 * This is the path of the `.git` folder for normal repositories,
320 * or of the repository itself for bare repositories.
321 *
322 * @param repo A repository object
323 * @return the path to the repository
324 */
9462c471 325GIT_EXTERN(const char *) git_repository_path(git_repository *repo);
6632c155
VM
326
327/**
328 * Get the path of the working directory for this repository
329 *
330 * If the repository is bare, this function will always return
331 * NULL.
332 *
333 * @param repo A repository object
334 * @return the path to the working dir, if it exists
335 */
9462c471 336GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
6632c155
VM
337
338/**
339 * Set the path to the working directory for this repository
340 *
341 * The working directory doesn't need to be the same one
342 * that contains the `.git` folder for this repository.
343 *
344 * If this repository is bare, setting its working directory
345 * will turn it into a normal repository, capable of performing
346 * all the common workdir operations (checkout, status, index
347 * manipulation, etc).
348 *
349 * @param repo A repository object
350 * @param workdir The path to a working directory
991a56c7
RB
351 * @param update_gitlink Create/update gitlink in workdir and set config
352 * "core.worktree" (if workdir is not the parent of the .git directory)
e172cf08 353 * @return 0, or an error code
6632c155 354 */
991a56c7
RB
355GIT_EXTERN(int) git_repository_set_workdir(
356 git_repository *repo, const char *workdir, int update_gitlink);
4a34b3a9 357
fa9bcd81 358/**
359 * Check if a repository is bare
360 *
361 * @param repo Repo to test
28ba94ce 362 * @return 1 if the repository is bare, 0 otherwise.
fa9bcd81 363 */
364GIT_EXTERN(int) git_repository_is_bare(git_repository *repo);
365
6632c155
VM
366/**
367 * Get the configuration file for this repository.
368 *
369 * If a configuration file has not been set, the default
370 * config set for the repository will be returned, including
371 * global and system configurations (if they are available).
372 *
373 * The configuration file must be freed once it's no longer
374 * being used by the user.
375 *
376 * @param out Pointer to store the loaded config file
377 * @param repo A repository object
e172cf08 378 * @return 0, or an error code
6632c155 379 */
9462c471 380GIT_EXTERN(int) git_repository_config(git_config **out, git_repository *repo);
6632c155
VM
381
382/**
383 * Set the configuration file for this repository
384 *
385 * This configuration file will be used for all configuration
386 * queries involving this repository.
387 *
388 * The repository will keep a reference to the config file;
389 * the user must still free the config after setting it
390 * to the repository, or it will leak.
391 *
392 * @param repo A repository object
393 * @param config A Config object
394 */
9462c471 395GIT_EXTERN(void) git_repository_set_config(git_repository *repo, git_config *config);
40fe5fbe 396
6632c155
VM
397/**
398 * Get the Object Database for this repository.
399 *
400 * If a custom ODB has not been set, the default
401 * database for the repository will be returned (the one
402 * located in `.git/objects`).
403 *
404 * The ODB must be freed once it's no longer being used by
405 * the user.
406 *
407 * @param out Pointer to store the loaded ODB
408 * @param repo A repository object
e172cf08 409 * @return 0, or an error code
6632c155 410 */
9462c471 411GIT_EXTERN(int) git_repository_odb(git_odb **out, git_repository *repo);
6632c155
VM
412
413/**
414 * Set the Object Database for this repository
415 *
416 * The ODB will be used for all object-related operations
417 * involving this repository.
418 *
419 * The repository will keep a reference to the ODB; the user
420 * must still free the ODB object after setting it to the
421 * repository, or it will leak.
422 *
423 * @param repo A repository object
424 * @param odb An ODB object
425 */
9462c471 426GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb);
b22d1479 427
6632c155
VM
428/**
429 * Get the Index file for this repository.
430 *
431 * If a custom index has not been set, the default
432 * index for the repository will be returned (the one
433 * located in `.git/index`).
434 *
435 * The index must be freed once it's no longer being used by
436 * the user.
437 *
438 * @param out Pointer to store the loaded index
439 * @param repo A repository object
e172cf08 440 * @return 0, or an error code
6632c155 441 */
9462c471 442GIT_EXTERN(int) git_repository_index(git_index **out, git_repository *repo);
6632c155
VM
443
444/**
445 * Set the index file for this repository
446 *
447 * This index will be used for all index-related operations
448 * involving this repository.
449 *
450 * The repository will keep a reference to the index file;
451 * the user must still free the index after setting it
452 * to the repository, or it will leak.
453 *
454 * @param repo A repository object
455 * @param index An index object
456 */
9462c471 457GIT_EXTERN(void) git_repository_set_index(git_repository *repo, git_index *index);
40fe5fbe 458
074841ec 459/**
cc548c7b 460 * Retrieve git's prepared message
074841ec
CMN
461 *
462 * Operations such as git revert/cherry-pick/merge with the -n option
463 * stop just short of creating a commit with the changes and save
464 * their prepared message in .git/MERGE_MSG so the next git-commit
465 * execution can present it to the user for them to amend if they
466 * wish.
467 *
468 * Use this function to get the contents of this file. Don't forget to
469 * remove the file after you create the commit.
e9ca852e 470 *
c9fc4a6f 471 * @param out Buffer to write data into or NULL to just read required size
e9ca852e
RB
472 * @param len Length of buffer in bytes
473 * @param repo Repository to read prepared message from
474 * @return Bytes written to buffer, GIT_ENOTFOUND if no message, or -1 on error
074841ec 475 */
c9fc4a6f 476GIT_EXTERN(int) git_repository_message(char *out, size_t len, git_repository *repo);
074841ec
CMN
477
478/**
479 * Remove git's prepared message.
480 *
481 * Remove the message that `git_repository_message` retrieves.
482 */
483GIT_EXTERN(int) git_repository_message_remove(git_repository *repo);
484
47bfa0be
RB
485/**
486 * Calculate hash of file using repository filtering rules.
487 *
488 * If you simply want to calculate the hash of a file on disk with no filters,
489 * you can just use the `git_odb_hashfile()` API. However, if you want to
490 * hash a file in the repository and you want to apply filtering rules (e.g.
491 * crlf filters) before generating the SHA, then use this function.
492 *
493 * @param out Output value of calculated SHA
a13fb55a 494 * @param repo Repository pointer
47bfa0be
RB
495 * @param path Path to file on disk whose contents should be hashed. If the
496 * repository is not NULL, this can be a relative path.
497 * @param type The object type to hash as (e.g. GIT_OBJ_BLOB)
498 * @param as_path The path to use to look up filtering rules. If this is
499 * NULL, then the `path` parameter will be used instead. If
500 * this is passed as the empty string, then no filters will be
501 * applied when calculating the hash.
502 */
503GIT_EXTERN(int) git_repository_hashfile(
504 git_oid *out,
505 git_repository *repo,
506 const char *path,
507 git_otype type,
508 const char *as_path);
074841ec 509
44af67a8 510/**
511 * Make the repository HEAD point to the specified reference.
512 *
513 * If the provided reference points to a Tree or a Blob, the HEAD is
514 * unaltered and -1 is returned.
515 *
516 * If the provided reference points to a branch, the HEAD will point
517 * to that branch, staying attached, or become attached if it isn't yet.
518 * If the branch doesn't exist yet, no error will be return. The HEAD
519 * will then be attached to an unborn branch.
520 *
521 * Otherwise, the HEAD will be detached and will directly point to
522 * the Commit.
523 *
524 * @param repo Repository pointer
525 * @param refname Canonical name of the reference the HEAD should point at
526 * @return 0 on success, or an error code
527 */
528GIT_EXTERN(int) git_repository_set_head(
529 git_repository* repo,
530 const char* refname);
531
4ebe38bd 532/**
533 * Make the repository HEAD directly point to the Commit.
534 *
535 * If the provided committish cannot be found in the repository, the HEAD
536 * is unaltered and GIT_ENOTFOUND is returned.
537 *
538 * If the provided commitish cannot be peeled into a commit, the HEAD
539 * is unaltered and -1 is returned.
540 *
541 * Otherwise, the HEAD will eventually be detached and will directly point to
542 * the peeled Commit.
543 *
544 * @param repo Repository pointer
545 * @param commitish Object id of the Commit the HEAD should point to
546 * @return 0 on success, or an error code
547 */
548GIT_EXTERN(int) git_repository_set_head_detached(
549 git_repository* repo,
550 const git_oid* commitish);
551
3f4c3072 552/**
553 * Detach the HEAD.
554 *
555 * If the HEAD is already detached and points to a Commit, 0 is returned.
556 *
557 * If the HEAD is already detached and points to a Tag, the HEAD is
558 * updated into making it point to the peeled Commit, and 0 is returned.
559 *
560 * If the HEAD is already detached and points to a non commitish, the HEAD is
561 * unaletered, and -1 is returned.
562 *
563 * Otherwise, the HEAD will be detached and point to the peeled Commit.
564 *
565 * @param repo Repository pointer
8b05bea8 566 * @return 0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing
875b16eb 567 * branch or an error code
3f4c3072 568 */
569GIT_EXTERN(int) git_repository_detach_head(
570 git_repository* repo);
571
632d8b23
ET
572typedef enum {
573 GIT_REPOSITORY_STATE_NONE,
574 GIT_REPOSITORY_STATE_MERGE,
575 GIT_REPOSITORY_STATE_REVERT,
576 GIT_REPOSITORY_STATE_CHERRY_PICK,
31966d20 577 GIT_REPOSITORY_STATE_BISECT,
578 GIT_REPOSITORY_STATE_REBASE,
579 GIT_REPOSITORY_STATE_REBASE_INTERACTIVE,
580 GIT_REPOSITORY_STATE_REBASE_MERGE,
581 GIT_REPOSITORY_STATE_APPLY_MAILBOX,
582 GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE,
632d8b23
ET
583} git_repository_state_t;
584
585/**
586 * Determines the status of a git repository - ie, whether an operation
587 * (merge, cherry-pick, etc) is in progress.
588 *
589 * @param repo Repository pointer
590 * @return The state of the repository
591 */
592GIT_EXTERN(int) git_repository_state(git_repository *repo);
593
3315782c
VM
594/** @} */
595GIT_END_DECL
596#endif