aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2016-09-04 18:08:39 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:14 -0700
commitfc6814637d2e756029b45cb5fd952359bfec6f88 (patch)
tree9c36d5e9db0ddefefcf2394e4e583736b2b08415 /refs
parente3688bd6cf159f6026a6bca7a6f53d0a22fe21a2 (diff)
downloadgit-fc6814637d2e756029b45cb5fd952359bfec6f88.tar.gz
git-fc6814637d2e756029b45cb5fd952359bfec6f88.tar.xz
refs: add method for initial ref transaction commit
Signed-off-by: Ronnie Sahlberg <rsahlberg@google.com> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 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.c8
-rw-r--r--refs/refs-internal.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 336d43257..0a511bf5a 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3829,11 +3829,12 @@ 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_store *ref_store,
+ struct ref_transaction *transaction,
+ struct strbuf *err)
{
struct files_ref_store *refs =
- get_files_ref_store(NULL, "initial_ref_transaction_commit");
+ files_downcast(ref_store, 0, "initial_ref_transaction_commit");
int ret = 0, i;
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
@@ -4061,6 +4062,7 @@ struct ref_storage_be refs_be_files = {
"files",
files_ref_store_create,
files_transaction_commit,
+ files_initial_transaction_commit,
files_pack_refs,
files_peel_ref,
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index a20b62261..08c85861e 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -582,6 +582,7 @@ struct ref_storage_be {
const char *name;
ref_store_init_fn *init;
ref_transaction_commit_fn *transaction_commit;
+ ref_transaction_commit_fn *initial_transaction_commit;
pack_refs_fn *pack_refs;
peel_ref_fn *peel_ref;