diff options
Diffstat (limited to 'src/refdb.c')
-rw-r--r-- | src/refdb.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/refdb.c b/src/refdb.c index adb58806e..69bf74734 100644 --- a/src/refdb.c +++ b/src/refdb.c @@ -167,14 +167,14 @@ void git_refdb_iterator_free(git_reference_iterator *iter) iter->free(iter); } -int git_refdb_write(git_refdb *db, git_reference *ref, int force) +int git_refdb_write(git_refdb *db, git_reference *ref, int force, const git_signature *who, const char *message, const git_oid *old_id, const char *old_target) { assert(db && db->backend); GIT_REFCOUNT_INC(db); ref->db = db; - return db->backend->write(db->backend, ref, force); + return db->backend->write(db->backend, ref, force, who, message, old_id, old_target); } int git_refdb_rename( @@ -182,12 +182,14 @@ int git_refdb_rename( git_refdb *db, const char *old_name, const char *new_name, - int force) + int force, + const git_signature *who, + const char *message) { int error; assert(db && db->backend); - error = db->backend->rename(out, db->backend, old_name, new_name, force); + error = db->backend->rename(out, db->backend, old_name, new_name, force, who, message); if (error < 0) return error; @@ -199,10 +201,10 @@ int git_refdb_rename( return 0; } -int git_refdb_delete(struct git_refdb *db, const char *ref_name) +int git_refdb_delete(struct git_refdb *db, const char *ref_name, const git_oid *old_id, const char *old_target) { assert(db && db->backend); - return db->backend->del(db->backend, ref_name); + return db->backend->del(db->backend, ref_name, old_id, old_target); } int git_refdb_reflog_read(git_reflog **out, git_refdb *db, const char *name) @@ -219,3 +221,24 @@ int git_refdb_reflog_read(git_reflog **out, git_refdb *db, const char *name) return 0; } + +int git_refdb_has_log(git_refdb *db, const char *refname) +{ + assert(db && refname); + + return db->backend->has_log(db->backend, refname); +} + +int git_refdb_ensure_log(git_refdb *db, const char *refname) +{ + assert(db && refname); + + return db->backend->ensure_log(db->backend, refname); +} + +int git_refdb_init_backend(git_refdb_backend *backend, unsigned int version) +{ + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + backend, version, git_refdb_backend, GIT_REFDB_BACKEND_INIT); + return 0; +} |