summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/refs.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/refs.c b/src/refs.c
index eff6b3356..d3d072cef 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -328,27 +328,15 @@ static int feed_reflog(
const char *log_message)
{
- git_reflog *reflog = NULL;
git_oid peeled_ref_oid;
int error;
- if ((error = git_reflog_read(&reflog, ref)) < 0)
- goto cleanup;
-
if ((error = git_reference_name_to_id(&peeled_ref_oid,
git_reference_owner(ref), git_reference_name(ref))) < 0)
- goto cleanup;
-
- if ((error = git_reflog_append(reflog, &peeled_ref_oid,
- signature, log_message)) < 0)
- goto cleanup;
-
- error = git_reflog_write(reflog);
-
-cleanup:
- git_reflog_free(reflog);
+ return error;
- return 0;
+ return git_reflog_append_to(git_reference_owner(ref), git_reference_name(ref),
+ &peeled_ref_oid, signature, log_message);
}
static int reference__create(