summaryrefslogtreecommitdiff
path: root/src/libgit2/reflog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgit2/reflog.c')
-rw-r--r--src/libgit2/reflog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libgit2/reflog.c b/src/libgit2/reflog.c
index 1e9c0d4f1..eb0b7e48c 100644
--- a/src/libgit2/reflog.c
+++ b/src/libgit2/reflog.c
@@ -104,7 +104,7 @@ int git_reflog_append(git_reflog *reflog, const git_oid *new_oid, const git_sign
previous = git_reflog_entry_byindex(reflog, 0);
if (previous == NULL)
- git_oid_fromstr(&entry->oid_old, GIT_OID_HEX_ZERO);
+ git_oid__fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO, GIT_OID_SHA1);
else
git_oid_cpy(&entry->oid_old, &previous->oid_cur);
@@ -218,8 +218,10 @@ int git_reflog_drop(git_reflog *reflog, size_t idx, int rewrite_previous_entry)
/* If the oldest entry has just been removed... */
if (idx == entrycount - 1) {
+ git_oid zero = GIT_OID_SHA1_ZERO;
+
/* ...clear the oid_old member of the "new" oldest entry */
- if (git_oid_fromstr(&entry->oid_old, GIT_OID_HEX_ZERO) < 0)
+ if (git_oid_cpy(&entry->oid_old, &zero) < 0)
return -1;
return 0;