if (*refs->submodule)
die("BUG: %s called for a submodule", caller);
}
+
+/* backend functions */
+int ref_transaction_commit(struct ref_transaction *transaction,
+ struct strbuf *err)
+{
+ struct ref_store *refs = get_ref_store(NULL);
+
+ return refs->be->transaction_commit(refs, transaction, err);
+}
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;
struct ref_storage_be refs_be_files = {
NULL,
"files",
- files_ref_store_create
+ files_ref_store_create,
+ files_transaction_commit
};
*/
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;