Thread (47 messages) flat view 47 messages, 3 authors, 2016-06-15
STALE3745d

[PATCH v5 08/27] refs: add method for initial ref transaction commit

From: David Turner <hidden>
Date: 2016-06-15 23:08:17
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Ronnie Sahlberg <redacted>
Signed-off-by: David Turner <redacted>
---
 refs.c               | 6 ++++++
 refs/files-backend.c | 5 +++--
 refs/refs-internal.h | 1 +
 3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 4733935..970729c 100644
--- a/refs.c
+++ b/refs.c
@@ -1287,3 +1287,9 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
 					       prepare_fn, should_prune_fn,
 					       cleanup_fn, policy_cb_data);
 }
+
+int initial_ref_transaction_commit(struct ref_transaction *transaction,
+				   struct strbuf *err)
+{
+	return the_refs_backend->initial_transaction_commit(transaction, err);
+}
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 149f6a2..2a663af 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3259,8 +3259,8 @@ static int ref_present(const char *refname,
 	return string_list_has_string(affected_refnames, refname);
 }
 
-int initial_ref_transaction_commit(struct ref_transaction *transaction,
-				   struct strbuf *err)
+static int files_initial_transaction_commit(struct ref_transaction *transaction,
+					    struct strbuf *err)
 {
 	int ret = 0, i;
 	int n = transaction->nr;
@@ -3484,6 +3484,7 @@ struct ref_storage_be refs_be_files = {
 	NULL,
 	"files",
 	files_transaction_commit,
+	files_initial_transaction_commit,
 
 	files_for_each_reflog_ent,
 	files_for_each_reflog_ent_reverse,
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 8b5bbdf..f9acd36 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -258,6 +258,7 @@ struct ref_storage_be {
 	struct ref_storage_be *next;
 	const char *name;
 	ref_transaction_commit_fn *transaction_commit;
+	ref_transaction_commit_fn *initial_transaction_commit;
 
 	for_each_reflog_ent_fn *for_each_reflog_ent;
 	for_each_reflog_ent_reverse_fn *for_each_reflog_ent_reverse;
-- 
2.4.2.767.g62658d5-twtrsrc
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help