summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-06-22 14:02:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-22 20:17:08 (GMT)
commitfc1c21689d6d82551f6136a3116876005b4e00a4 (patch)
tree44bbe126fb0c3835bd4d6e71726cfcec5ae40bca /refs.h
parenta5fe66802f8c4036badd54ff36ff327d43236e7e (diff)
downloadgit-fc1c21689d6d82551f6136a3116876005b4e00a4.zip
git-fc1c21689d6d82551f6136a3116876005b4e00a4.tar.gz
git-fc1c21689d6d82551f6136a3116876005b4e00a4.tar.bz2
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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 8c3d433..68b5e81 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);