summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/oid.c b/src/oid.c
index 2348d1434..8274cb55c 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -175,6 +175,16 @@ int git__write_oid(git_odb_stream *stream, const char *header, const git_oid *oi
return GIT_SUCCESS;
}
+void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid)
+{
+ char hex_oid[GIT_OID_HEXSZ];
+
+ git_oid_fmt(hex_oid, oid);
+ git_buf_puts(buf, header);
+ git_buf_put(buf, hex_oid, GIT_OID_HEXSZ);
+ git_buf_putc(buf, '\n');
+}
+
void git_oid_fromraw(git_oid *out, const unsigned char *raw)
{
memcpy(out->id, raw, sizeof(out->id));