From 4b7b520b9f761704400a82285d0812fd9e50957f Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Tue, 17 Feb 2015 18:00:22 +0100 Subject: update_ref(): improve documentation Add a docstring for update_ref(), emphasizing its similarity to ref_transaction_update(). Rename its parameters to match those of ref_transaction_update(). Signed-off-by: Michael Haggerty Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- refs.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 5e139d5f8c..bb9d7b5a02 100644 --- a/refs.h +++ b/refs.h @@ -344,9 +344,16 @@ int ref_transaction_commit(struct ref_transaction *transaction, */ void ref_transaction_free(struct ref_transaction *transaction); -/** Lock a ref and then write its file */ -int update_ref(const char *action, const char *refname, - const unsigned char *sha1, const unsigned char *oldval, +/** + * Lock, update, and unlock a single reference. This function + * basically does a transaction containing a single call to + * ref_transaction_update(). The parameters to this function have the + * same meaning as the corresponding parameters to + * ref_transaction_update(). Handle errors as requested by the `onerr` + * argument. + */ +int update_ref(const char *msg, const char *refname, + const unsigned char *new_sha1, const unsigned char *old_sha1, unsigned int flags, enum action_on_err onerr); extern int parse_hide_refs_config(const char *var, const char *value, const char *); -- cgit v1.3