diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-03-26 09:42:35 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-14 03:53:25 -0700 |
commit | c0fe4e8ba3db828079f1288169a94294e713b3d8 (patch) | |
tree | 1d07025e41a5624acbad8cbfad1d7969a986d3c4 /refs.h | |
parent | 7d2df051d05bc65a0a540ba080f07b421b4d99d7 (diff) | |
download | git-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.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); |