log_ref_write(): inline function
This function doesn't do anything beyond call files_log_ref_write(), so replace it with the latter at its call sites. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
990c98d2bd
commit
81b1b6d4ff
@ -2832,14 +2832,6 @@ static int log_ref_write_1(const char *refname, const unsigned char *old_sha1,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int log_ref_write(const char *refname, const unsigned char *old_sha1,
|
||||
const unsigned char *new_sha1, const char *msg,
|
||||
int flags, struct strbuf *err)
|
||||
{
|
||||
return files_log_ref_write(refname, old_sha1, new_sha1, msg, flags,
|
||||
err);
|
||||
}
|
||||
|
||||
int files_log_ref_write(const char *refname, const unsigned char *old_sha1,
|
||||
const unsigned char *new_sha1, const char *msg,
|
||||
int flags, struct strbuf *err)
|
||||
@ -2903,7 +2895,8 @@ static int commit_ref_update(struct files_ref_store *refs,
|
||||
assert_main_repository(&refs->base, "commit_ref_update");
|
||||
|
||||
clear_loose_ref_cache(refs);
|
||||
if (log_ref_write(lock->ref_name, lock->old_oid.hash, sha1, logmsg, 0, err)) {
|
||||
if (files_log_ref_write(lock->ref_name, lock->old_oid.hash, sha1,
|
||||
logmsg, 0, err)) {
|
||||
char *old_msg = strbuf_detach(err, NULL);
|
||||
strbuf_addf(err, "cannot update the ref '%s': %s",
|
||||
lock->ref_name, old_msg);
|
||||
@ -2934,7 +2927,7 @@ static int commit_ref_update(struct files_ref_store *refs,
|
||||
if (head_ref && (head_flag & REF_ISSYMREF) &&
|
||||
!strcmp(head_ref, lock->ref_name)) {
|
||||
struct strbuf log_err = STRBUF_INIT;
|
||||
if (log_ref_write("HEAD", lock->old_oid.hash, sha1,
|
||||
if (files_log_ref_write("HEAD", lock->old_oid.hash, sha1,
|
||||
logmsg, 0, &log_err)) {
|
||||
error("%s", log_err.buf);
|
||||
strbuf_release(&log_err);
|
||||
@ -2973,7 +2966,8 @@ static void update_symref_reflog(struct ref_lock *lock, const char *refname,
|
||||
struct strbuf err = STRBUF_INIT;
|
||||
unsigned char new_sha1[20];
|
||||
if (logmsg && !read_ref(target, new_sha1) &&
|
||||
log_ref_write(refname, lock->old_oid.hash, new_sha1, logmsg, 0, &err)) {
|
||||
files_log_ref_write(refname, lock->old_oid.hash, new_sha1,
|
||||
logmsg, 0, &err)) {
|
||||
error("%s", err.buf);
|
||||
strbuf_release(&err);
|
||||
}
|
||||
@ -3748,9 +3742,11 @@ static int files_transaction_commit(struct ref_store *ref_store,
|
||||
|
||||
if (update->flags & REF_NEEDS_COMMIT ||
|
||||
update->flags & REF_LOG_ONLY) {
|
||||
if (log_ref_write(lock->ref_name, lock->old_oid.hash,
|
||||
update->new_sha1,
|
||||
update->msg, update->flags, err)) {
|
||||
if (files_log_ref_write(lock->ref_name,
|
||||
lock->old_oid.hash,
|
||||
update->new_sha1,
|
||||
update->msg, update->flags,
|
||||
err)) {
|
||||
char *old_msg = strbuf_detach(err, NULL);
|
||||
|
||||
strbuf_addf(err, "cannot update the ref '%s': %s",
|
||||
|
Loading…
Reference in New Issue
Block a user