summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2016-09-04 16:08:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-09 22:28:12 (GMT)
commit127b42a18618538438b811a29cd95e79c646eb70 (patch)
tree7c13fbd10b9e1f31ba38249c2fb186ebdec6d34a /refs
parent49c0df6a68c6c02a75e306c34e4e9d2bfa645892 (diff)
downloadgit-127b42a18618538438b811a29cd95e79c646eb70.zip
git-127b42a18618538438b811a29cd95e79c646eb70.tar.gz
git-127b42a18618538438b811a29cd95e79c646eb70.tar.bz2
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c10
-rw-r--r--refs/refs-internal.h5
2 files changed, 11 insertions, 4 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1740441..2d847f5 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -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
};
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index b952038..b7367ab 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -535,10 +535,15 @@ int read_raw_ref(const char *refname, unsigned char *sha1,
*/
typedef struct ref_store *ref_store_init_fn(const char *submodule);
+typedef int ref_transaction_commit_fn(struct ref_store *refs,
+ struct ref_transaction *transaction,
+ struct strbuf *err);
+
struct ref_storage_be {
struct ref_storage_be *next;
const char *name;
ref_store_init_fn *init;
+ ref_transaction_commit_fn *transaction_commit;
};
extern struct ref_storage_be refs_be_files;