Signed-off-by: Michael Haggerty <[email protected]>
---
refs.c | 9 +++++++++
refs/files-backend.c | 7 ++++++-
refs/refs-internal.h | 5 +++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index f4f5f32..22837f4 100644
--- a/refs.c
+++ b/refs.c
@@ -1425,6 +1425,15 @@ int pack_refs(unsigned int flags)
return refs->be->pack_refs(refs, flags);
}
+int create_symref(const char *ref_target, const char *refs_heads_master,
+ const char *logmsg)
+{
+ struct ref_store *refs = get_ref_store(NULL);
+
+ return refs->be->create_symref(refs, ref_target, refs_heads_master,
+ logmsg);
+}
+
int ref_transaction_commit(struct ref_transaction *transaction,
struct strbuf *err)
{
diff --git a/refs/files-backend.c b/refs/files-backend.c
index e5a8799..f82a1be 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3015,12 +3015,16 @@ static int create_symref_locked(struct ref_lock *lock,
const char *refname,
return 0;
}
-int create_symref(const char *refname, const char *target, const char *logmsg)
+static int files_create_symref(struct ref_store *ref_store,
+ const char *refname, const char *target,
+ const char *logmsg)
{
struct strbuf err = STRBUF_INIT;
struct ref_lock *lock;
int ret;
+ files_downcast(ref_store, 0, "create_symref");
+
lock = lock_ref_sha1_basic(refname, NULL, NULL, NULL, REF_NODEREF, NULL,
&err);
if (!lock) {
@@ -4027,6 +4031,7 @@ struct ref_storage_be refs_be_files = {
files_transaction_commit,
files_pack_refs,
+ files_create_symref,
files_read_raw_ref,
files_verify_refname_available
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 578c125..c342e57 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -496,6 +496,10 @@ typedef int ref_transaction_commit_fn(struct ref_store
*refs,
struct strbuf *err);
typedef int pack_refs_fn(struct ref_store *ref_store, unsigned int flags);
+typedef int create_symref_fn(struct ref_store *ref_store,
+ const char *ref_target,
+ const char *refs_heads_master,
+ const char *logmsg);
/*
* Read a reference from the specified reference store, non-recursively.
@@ -552,6 +556,7 @@ struct ref_storage_be {
ref_transaction_commit_fn *transaction_commit;
pack_refs_fn *pack_refs;
+ create_symref_fn *create_symref;
read_raw_ref_fn *read_raw_ref;
verify_refname_available_fn *verify_refname_available;
--
2.8.1
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html