]> git.proxmox.com Git - libgit2.git/blob - src/refdb.h
Update branching information in d/gbp.conf
[libgit2.git] / src / refdb.h
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 #ifndef INCLUDE_refdb_h__
8 #define INCLUDE_refdb_h__
9
10 #include "common.h"
11
12 #include "git2/refdb.h"
13 #include "repository.h"
14
15 struct git_refdb {
16 git_refcount rc;
17 git_repository *repo;
18 git_refdb_backend *backend;
19 };
20
21 void git_refdb__free(git_refdb *db);
22
23 int git_refdb_exists(
24 int *exists,
25 git_refdb *refdb,
26 const char *ref_name);
27
28 int git_refdb_lookup(
29 git_reference **out,
30 git_refdb *refdb,
31 const char *ref_name);
32
33 int git_refdb_rename(
34 git_reference **out,
35 git_refdb *db,
36 const char *old_name,
37 const char *new_name,
38 int force,
39 const git_signature *who,
40 const char *message);
41
42 int git_refdb_iterator(git_reference_iterator **out, git_refdb *db, const char *glob);
43 int git_refdb_iterator_next(git_reference **out, git_reference_iterator *iter);
44 int git_refdb_iterator_next_name(const char **out, git_reference_iterator *iter);
45 void git_refdb_iterator_free(git_reference_iterator *iter);
46
47 int git_refdb_write(git_refdb *refdb, git_reference *ref, int force, const git_signature *who, const char *message, const git_oid *old_id, const char *old_target);
48 int git_refdb_delete(git_refdb *refdb, const char *ref_name, const git_oid *old_id, const char *old_target);
49
50 int git_refdb_reflog_read(git_reflog **out, git_refdb *db, const char *name);
51 int git_refdb_reflog_write(git_reflog *reflog);
52
53 int git_refdb_has_log(git_refdb *db, const char *refname);
54 int git_refdb_ensure_log(git_refdb *refdb, const char *refname);
55
56 int git_refdb_lock(void **payload, git_refdb *db, const char *refname);
57 int git_refdb_unlock(git_refdb *db, void *payload, int success, int update_reflog, const git_reference *ref, const git_signature *sig, const char *message);
58
59 #endif