summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/reflog.c2
-rw-r--r--src/reflog.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/reflog.c b/src/reflog.c
index 004ba936d..0e0758381 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -258,7 +258,7 @@ int git_reflog_write(git_reference *ref, const git_oid *oid_old,
if (oid_old)
git_oid_tostr(old, sizeof(old), oid_old);
else
- p_snprintf(old, sizeof(old), "%0*d", GIT_OID_HEXSZ, 0);
+ memmove(old, GIT_OID_HEX_ZERO, sizeof(old));
error = reflog_write(log_path.ptr, old, new, committer, msg);
diff --git a/src/reflog.h b/src/reflog.h
index 33cf0776c..fe2891909 100644
--- a/src/reflog.h
+++ b/src/reflog.h
@@ -17,6 +17,8 @@
#define GIT_REFLOG_SIZE_MIN (2*GIT_OID_HEXSZ+2+17)
+#define GIT_OID_HEX_ZERO "0000000000000000000000000000000000000000"
+
struct git_reflog_entry {
git_oid oid_old;
git_oid oid_cur;