refs: add a transaction_commit() method

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ronnie Sahlberg
2016-09-04 18:08:16 +02:00
committed by Junio C Hamano
parent 49c0df6a68
commit 127b42a186
3 changed files with 20 additions and 4 deletions

View File

@ -3700,11 +3700,12 @@ static int lock_ref_for_update(struct ref_update *update,
return 0;
}
int ref_transaction_commit(struct ref_transaction *transaction,
struct strbuf *err)
static int files_transaction_commit(struct ref_store *ref_store,
struct ref_transaction *transaction,
struct strbuf *err)
{
struct files_ref_store *refs =
get_files_ref_store(NULL, "ref_transaction_commit");
files_downcast(ref_store, 0, "ref_transaction_commit");
int ret = 0, i;
struct string_list refs_to_delete = STRING_LIST_INIT_NODUP;
struct string_list_item *ref_to_delete;
@ -4093,5 +4094,6 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
struct ref_storage_be refs_be_files = {
NULL,
"files",
files_ref_store_create
files_ref_store_create,
files_transaction_commit
};