1 /*
2  * Copyright (C) the libgit2 contributors. All rights reserved.
3  *
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.
6  */
7 module libgit2_d.refdb;
8 
9 
10 private static import libgit2_d.types;
11 
12 /**
13  * @file git2/refdb.h
14  * @brief Git custom refs backend functions
15  * @defgroup git_refdb Git custom refs backend API
16  * @ingroup Git
17  * @{
18  */
19 extern (C):
20 nothrow @nogc:
21 public:
22 
23 /**
24  * Create a new reference database with no backends.
25  *
26  * Before the Ref DB can be used for read/writing, a custom database
27  * backend must be manually set using `git_refdb_set_backend()`
28  *
29  * Params:
30  *      out_ = location to store the database pointer, if opened. Set to null if the open failed.
31  *      repo = the repository
32  *
33  * Returns: 0 or an error code
34  */
35 //GIT_EXTERN
36 int git_refdb_new(libgit2_d.types.git_refdb** out_, libgit2_d.types.git_repository* repo);
37 
38 /**
39  * Create a new reference database and automatically add
40  * the default backends:
41  *
42  *  - git_refdb_dir: read and write loose and packed refs
43  *      from disk, assuming the repository dir as the folder
44  *
45  * Params:
46  *      out_ = location to store the database pointer, if opened. Set to null if the open failed.
47  *      repo = the repository
48  *
49  * Returns: 0 or an error code
50  */
51 //GIT_EXTERN
52 int git_refdb_open(libgit2_d.types.git_refdb** out_, libgit2_d.types.git_repository* repo);
53 
54 /**
55  * Suggests that the given refdb compress or optimize its references.
56  * This mechanism is implementation specific.  For on-disk reference
57  * databases, for example, this may pack all loose references.
58  */
59 //GIT_EXTERN
60 int git_refdb_compress(libgit2_d.types.git_refdb* refdb);
61 
62 /**
63  * Close an open reference database.
64  *
65  * Params:
66  *      refdb = reference database pointer or null
67  */
68 //GIT_EXTERN
69 void git_refdb_free(libgit2_d.types.git_refdb* refdb);
70 
71 /** @} */