diff options
| author | Ben Straub <bs@github.com> | 2013-10-28 06:20:28 -0700 |
|---|---|---|
| committer | Ben Straub <bs@github.com> | 2013-10-28 06:20:28 -0700 |
| commit | 8f4a8b096ba35a2af3f9c51dad7e0402790b58ac (patch) | |
| tree | 80a707dd35672be1f88506c04058b7fad9947fa6 /include/git2/sys | |
| parent | a1efa5960d8f874b92403d875bf08a22c7be2437 (diff) | |
| parent | 0174794a955dbec1e2d9ecf581833fc23c7e844c (diff) | |
| download | libgit2-8f4a8b096ba35a2af3f9c51dad7e0402790b58ac.tar.gz | |
Merge pull request #1802 from libgit2/cmn/reflog-backend
Make reflog part of refdb
Diffstat (limited to 'include/git2/sys')
| -rw-r--r-- | include/git2/sys/refdb_backend.h | 20 | ||||
| -rw-r--r-- | include/git2/sys/reflog.h | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h index addaa86fd..9cf5073fb 100644 --- a/include/git2/sys/refdb_backend.h +++ b/include/git2/sys/refdb_backend.h @@ -119,6 +119,26 @@ struct git_refdb_backend { * provide this function; if it is not provided, nothing will be done. */ void (*free)(git_refdb_backend *backend); + + /** + * Read the reflog for the given reference name. + */ + int (*reflog_read)(git_reflog **out, git_refdb_backend *backend, const char *name); + + /** + * Write a reflog to disk. + */ + int (*reflog_write)(git_refdb_backend *backend, git_reflog *reflog); + + /** + * Rename a reflog + */ + int (*reflog_rename)(git_refdb_backend *_backend, const char *old_name, const char *new_name); + + /** + * Remove a reflog. + */ + int (*reflog_delete)(git_refdb_backend *backend, const char *name); }; #define GIT_REFDB_BACKEND_VERSION 1 diff --git a/include/git2/sys/reflog.h b/include/git2/sys/reflog.h new file mode 100644 index 000000000..c9d0041b9 --- /dev/null +++ b/include/git2/sys/reflog.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_sys_git_reflog_h__ +#define INCLUDE_sys_git_reflog_h__ + +#include "git2/common.h" +#include "git2/types.h" +#include "git2/oid.h" + +GIT_BEGIN_DECL + +GIT_EXTERN(git_reflog_entry *) git_reflog_entry__alloc(void); +GIT_EXTERN(void) git_reflog_entry__free(git_reflog_entry *entry); + +GIT_END_DECL + +#endif |
