summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-07-17 10:53:19 +0200
committernulltoken <emeric.fermas@gmail.com>2012-07-25 07:53:27 +0200
commit7c458e3aee7b39bfec368456d494972fe9ae244b (patch)
tree03c3115e072c1c08e54a16abb4808b55b4e32b7e /src
parent1cb157184b6547b613a008455ba386425bb38a23 (diff)
downloadlibgit2-7c458e3aee7b39bfec368456d494972fe9ae244b.tar.gz
reflog: add GIT_OID_HEX_ZERO constant
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;