]>
Commit | Line | Data |
---|---|---|
d00d5464 ET |
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 "git2/refdb.h" | |
11 | #include "repository.h" | |
12 | ||
13 | struct git_refdb { | |
14 | git_refcount rc; | |
15 | git_repository *repo; | |
16 | git_refdb_backend *backend; | |
17 | }; | |
18 | ||
979f75d8 VM |
19 | void git_refdb__free(git_refdb *db); |
20 | ||
d00d5464 ET |
21 | int git_refdb_exists( |
22 | int *exists, | |
23 | git_refdb *refdb, | |
24 | const char *ref_name); | |
25 | ||
26 | int git_refdb_lookup( | |
27 | git_reference **out, | |
28 | git_refdb *refdb, | |
29 | const char *ref_name); | |
30 | ||
4e6e2ff2 VM |
31 | int git_refdb_rename( |
32 | git_reference **out, | |
33 | git_refdb *db, | |
34 | const char *old_name, | |
35 | const char *new_name, | |
110df893 | 36 | int force, |
a57dd3b7 | 37 | const git_signature *who, |
110df893 | 38 | const char *message); |
4e6e2ff2 | 39 | |
ec24e542 VM |
40 | int git_refdb_iterator(git_reference_iterator **out, git_refdb *db, const char *glob); |
41 | int git_refdb_iterator_next(git_reference **out, git_reference_iterator *iter); | |
42 | int git_refdb_iterator_next_name(const char **out, git_reference_iterator *iter); | |
4def7035 CMN |
43 | void git_refdb_iterator_free(git_reference_iterator *iter); |
44 | ||
91123661 | 45 | 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); |
7ee8c7e6 | 46 | int git_refdb_delete(git_refdb *refdb, const char *ref_name, const git_oid *old_id, const char *old_target); |
d00d5464 | 47 | |
b976f3c2 CMN |
48 | int git_refdb_reflog_read(git_reflog **out, git_refdb *db, const char *name); |
49 | int git_refdb_reflog_write(git_reflog *reflog); | |
50 | ||
f2105129 | 51 | int git_refdb_has_log(git_refdb *db, const char *refname); |
8d5ec910 CMN |
52 | int git_refdb_ensure_log(git_refdb *refdb, const char *refname); |
53 | ||
ab8d9242 CMN |
54 | int git_refdb_lock(void **payload, git_refdb *db, const char *refname); |
55 | 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); | |
b976f3c2 | 56 | |
d00d5464 | 57 | #endif |