summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-03-26 09:42:35 +0700
committerJunio C Hamano <gitster@pobox.com>2017-04-14 03:53:25 -0700
commitc0fe4e8ba3db828079f1288169a94294e713b3d8 (patch)
tree1d07025e41a5624acbad8cbfad1d7969a986d3c4 /refs.h
parent7d2df051d05bc65a0a540ba080f07b421b4d99d7 (diff)
downloadgit-c0fe4e8ba3db828079f1288169a94294e713b3d8.tar.gz
refs: new transaction related ref-store api
The transaction struct now takes a ref store at creation and will operate on that ref store alone. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index eaa31e8193..37f4aa8bd5 100644
--- a/refs.h
+++ b/refs.h
@@ -333,6 +333,10 @@ int reflog_exists(const char *refname);
* exists, regardless of its old value. It is an error for old_sha1 to
* be NULL_SHA1. flags is passed through to ref_transaction_delete().
*/
+int refs_delete_ref(struct ref_store *refs, const char *msg,
+ const char *refname,
+ const unsigned char *old_sha1,
+ unsigned int flags);
int delete_ref(const char *msg, const char *refname,
const unsigned char *old_sha1, unsigned int flags);
@@ -418,6 +422,8 @@ enum action_on_err {
* Begin a reference transaction. The reference transaction must
* be freed by calling ref_transaction_free().
*/
+struct ref_transaction *ref_store_transaction_begin(struct ref_store *refs,
+ struct strbuf *err);
struct ref_transaction *ref_transaction_begin(struct strbuf *err);
/*
@@ -552,6 +558,9 @@ void ref_transaction_free(struct ref_transaction *transaction);
* ref_transaction_update(). Handle errors as requested by the `onerr`
* argument.
*/
+int refs_update_ref(struct ref_store *refs, const char *msg, const char *refname,
+ const unsigned char *new_sha1, const unsigned char *old_sha1,
+ unsigned int flags, enum action_on_err onerr);
int update_ref(const char *msg, const char *refname,
const unsigned char *new_sha1, const unsigned char *old_sha1,
unsigned int flags, enum action_on_err onerr);