From 9b148098e6802f9dd797471fc4f20cfc58a846b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 18 Dec 2013 19:58:16 +0100 Subject: refs: conditional ref updates Allow updating references if the old value matches the given one. --- include/git2/sys/refdb_backend.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/git2/sys/refdb_backend.h') diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h index 5bbd4ba4c..e43f9960b 100644 --- a/include/git2/sys/refdb_backend.h +++ b/include/git2/sys/refdb_backend.h @@ -94,7 +94,8 @@ struct git_refdb_backend { */ int (*write)(git_refdb_backend *backend, const git_reference *ref, int force, - const git_signature *who, const char *message); + const git_signature *who, const char *message, + const git_oid *old); int (*rename)( git_reference **out, git_refdb_backend *backend, -- cgit v1.2.1 From 911236619b5d774e33dd9f3de92a7c86c2befb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 4 Feb 2014 22:04:00 +0100 Subject: refdb: add conditional symbolic updates Add a parameter to the backend to allow checking for the old symbolic target. --- include/git2/sys/refdb_backend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/sys/refdb_backend.h') diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h index e43f9960b..13ce9a026 100644 --- a/include/git2/sys/refdb_backend.h +++ b/include/git2/sys/refdb_backend.h @@ -95,7 +95,7 @@ struct git_refdb_backend { int (*write)(git_refdb_backend *backend, const git_reference *ref, int force, const git_signature *who, const char *message, - const git_oid *old); + const git_oid *old, const char *old_target); int (*rename)( git_reference **out, git_refdb_backend *backend, -- cgit v1.2.1 From 7ee8c7e6776a3c5b3a45cfd10ccf205eebb3f3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 5 Feb 2014 11:07:34 +0100 Subject: refs: placeholder conditional delete We don't actually pass the old value yet. --- include/git2/sys/refdb_backend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/sys/refdb_backend.h') diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h index 13ce9a026..aa5ef9ecc 100644 --- a/include/git2/sys/refdb_backend.h +++ b/include/git2/sys/refdb_backend.h @@ -106,7 +106,7 @@ struct git_refdb_backend { * Deletes the given reference from the refdb. A refdb implementation * must provide this function. */ - int (*del)(git_refdb_backend *backend, const char *ref_name); + int (*del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target); /** * Suggests that the given refdb compress or optimize its references. -- cgit v1.2.1