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;
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;
}
ref_transaction_add_update(transaction, refname, flags,
new_oid, old_oid, new_target,
- old_target, msg);
+ old_target, NULL, msg);
return 0;
}
ref_transaction_add_update(
transaction, r->name,
REF_NO_DEREF | REF_HAVE_NEW | REF_HAVE_OLD | REF_IS_PRUNING,
- null_oid(), &r->oid, NULL, NULL, NULL);
+ null_oid(), &r->oid, NULL, NULL, NULL, NULL);
if (ref_transaction_commit(transaction, &err))
goto cleanup;
transaction, "HEAD",
update->flags | REF_LOG_ONLY | REF_NO_DEREF,
&update->new_oid, &update->old_oid,
- NULL, NULL, update->msg);
+ NULL, NULL, update->committer_info, update->msg);
/*
* Add "HEAD". This insertion is O(N) in the transaction
transaction, referent, new_flags,
update->new_target ? NULL : &update->new_oid,
update->old_target ? NULL : &update->old_oid,
- update->new_target, update->old_target, update->msg);
+ update->new_target, update->old_target, NULL,
+ update->msg);
new_update->parent_update = update;
packed_transaction, update->refname,
REF_HAVE_NEW | REF_NO_DEREF,
&update->new_oid, NULL,
- NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL);
}
}
ref_transaction_add_update(loose_transaction, update->refname,
update->flags & ~REF_HAVE_OLD,
update->new_target ? NULL : &update->new_oid, NULL,
- update->new_target, NULL, NULL);
+ update->new_target, NULL, update->committer_info,
+ NULL);
} else {
ref_transaction_add_update(packed_transaction, update->refname,
update->flags & ~REF_HAVE_OLD,
&update->new_oid, &update->old_oid,
- NULL, NULL, NULL);
+ NULL, NULL, update->committer_info, NULL);
}
}
new_update = ref_transaction_add_update(
transaction, "HEAD",
u->flags | REF_LOG_ONLY | REF_NO_DEREF,
- &u->new_oid, &u->old_oid, NULL, NULL, u->msg);
+ &u->new_oid, &u->old_oid, NULL, NULL, NULL,
+ u->msg);
string_list_insert(&affected_refnames, new_update->refname);
}
transaction, referent.buf, new_flags,
u->new_target ? NULL : &u->new_oid,
u->old_target ? NULL : &u->old_oid,
- u->new_target, u->old_target, u->msg);
+ u->new_target, u->old_target,
+ u->committer_info, u->msg);
new_update->parent_update = u;