From fc1c21689d6d82551f6136a3116876005b4e00a4 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 22 Jun 2015 16:02:52 +0200 Subject: delete_ref(): move declaration to refs.h Also * Add a docstring * Rename the second parameter to "old_sha1", to be consistent with the convention used elsewhere in the refs module Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 8c3d433a8a..68b5e81e2d 100644 --- a/refs.h +++ b/refs.h @@ -202,6 +202,16 @@ extern int read_ref_at(const char *refname, unsigned int flags, /** Check if a particular reflog exists */ extern int reflog_exists(const char *refname); +/* + * Delete the specified reference. If old_sha1 is non-NULL and not + * NULL_SHA1, then verify that the current value of the reference is + * old_sha1 before deleting it. If old_sha1 is NULL or NULL_SHA1, + * delete the reference if it exists, regardless of its old value. + * flags is passed through to ref_transaction_delete(). + */ +extern int delete_ref(const char *refname, const unsigned char *old_sha1, + unsigned int flags); + /** Delete a reflog */ extern int delete_reflog(const char *refname); -- cgit v1.3-5-g9baa