diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-02-17 18:00:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-17 11:25:03 -0800 |
commit | 4b7b520b9f761704400a82285d0812fd9e50957f (patch) | |
tree | e44bdfacdd503994447d239c28003f616b0273a1 /refs.c | |
parent | ref_transaction_verify(): new function to check a reference's value (diff) | |
download | tgif-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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"; |