refs: add committer_info
to ref_transaction_add_update()
The `ref_transaction_add_update()` creates the `ref_update` struct. To facilitate addition of reflogs in the next commit, the function needs to accommodate setting the `committer_info` field in the struct. So modify the function to also take `committer_info` as an argument and set it accordingly. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
add2c4f6e2
commit
4483be36f4
7
refs.c
7
refs.c
@ -1166,6 +1166,7 @@ struct ref_update *ref_transaction_add_update(
|
||||
const struct object_id *new_oid,
|
||||
const struct object_id *old_oid,
|
||||
const char *new_target, const char *old_target,
|
||||
const char *committer_info,
|
||||
const char *msg)
|
||||
{
|
||||
struct ref_update *update;
|
||||
@ -1190,8 +1191,10 @@ struct ref_update *ref_transaction_add_update(
|
||||
oidcpy(&update->new_oid, new_oid);
|
||||
if ((flags & REF_HAVE_OLD) && old_oid)
|
||||
oidcpy(&update->old_oid, old_oid);
|
||||
if (!(flags & REF_SKIP_CREATE_REFLOG))
|
||||
if (!(flags & REF_SKIP_CREATE_REFLOG)) {
|
||||
update->committer_info = xstrdup_or_null(committer_info);
|
||||
update->msg = normalize_reflog_message(msg);
|
||||
}
|
||||
|
||||
return update;
|
||||
}
|
||||
@ -1253,7 +1256,7 @@ int ref_transaction_update(struct ref_transaction *transaction,
|
||||
|
||||
ref_transaction_add_update(transaction, refname, flags,
|
||||
new_oid, old_oid, new_target,
|
||||
old_target, msg);
|
||||
old_target, NULL, msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user