refs.c: pass the ref log message to _create/delete/update instead of _commit

Change the ref transaction API so that we pass the reflog message to the
create/delete/update functions instead of to ref_transaction_commit.
This allows different reflog messages for each ref update in a multi-ref
transaction.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ronnie Sahlberg
2014-04-30 12:22:42 -07:00
committed by Junio C Hamano
parent dbdcac7d5c
commit db7516ab9f
11 changed files with 54 additions and 44 deletions

12
refs.h
View File

@ -274,8 +274,8 @@ struct ref_transaction *ref_transaction_begin(struct strbuf *err);
* The following functions add a reference check or update to a
* ref_transaction. In all of them, refname is the name of the
* reference to be affected. The functions make internal copies of
* refname, so the caller retains ownership of the parameter. flags
* can be REF_NODEREF; it is passed to update_ref_lock().
* refname and msg, so the caller retains ownership of these parameters.
* flags can be REF_NODEREF; it is passed to update_ref_lock().
*/
/*
@ -292,7 +292,7 @@ int ref_transaction_update(struct ref_transaction *transaction,
const char *refname,
const unsigned char *new_sha1,
const unsigned char *old_sha1,
int flags, int have_old,
int flags, int have_old, const char *msg,
struct strbuf *err);
/*
@ -307,7 +307,7 @@ int ref_transaction_update(struct ref_transaction *transaction,
int ref_transaction_create(struct ref_transaction *transaction,
const char *refname,
const unsigned char *new_sha1,
int flags,
int flags, const char *msg,
struct strbuf *err);
/*
@ -321,7 +321,7 @@ int ref_transaction_create(struct ref_transaction *transaction,
int ref_transaction_delete(struct ref_transaction *transaction,
const char *refname,
const unsigned char *old_sha1,
int flags, int have_old,
int flags, int have_old, const char *msg,
struct strbuf *err);
/*
@ -330,7 +330,7 @@ int ref_transaction_delete(struct ref_transaction *transaction,
* problem.
*/
int ref_transaction_commit(struct ref_transaction *transaction,
const char *msg, struct strbuf *err);
struct strbuf *err);
/*
* Free an existing transaction and all associated data.