summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2015-02-17 18:00:22 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-02-17 11:25:03 -0800
commit4b7b520b9f761704400a82285d0812fd9e50957f (patch)
treee44bdfacdd503994447d239c28003f616b0273a1 /refs.c
parentref_transaction_verify(): new function to check a reference's value (diff)
downloadtgif-4b7b520b9f761704400a82285d0812fd9e50957f.tar.xz
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 <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 1aaba3f7f7..8d46b08055 100644
--- a/refs.c
+++ b/refs.c
@@ -3738,8 +3738,8 @@ int ref_transaction_verify(struct ref_transaction *transaction,
flags, NULL, err);
}
-int update_ref(const char *action, const char *refname,
- const unsigned char *sha1, const unsigned char *oldval,
+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)
{
struct ref_transaction *t;
@@ -3747,8 +3747,8 @@ int update_ref(const char *action, const char *refname,
t = ref_transaction_begin(&err);
if (!t ||
- ref_transaction_update(t, refname, sha1, oldval,
- flags, action, &err) ||
+ ref_transaction_update(t, refname, new_sha1, old_sha1,
+ flags, msg, &err) ||
ref_transaction_commit(t, &err)) {
const char *str = "update_ref failed for ref '%s': %s";