From 69d124255ede771ff8162652762406c55ba491c0 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 2 May 2018 00:25:29 +0000 Subject: cache: add a function to read an object ID from a buffer In various places throughout the codebase, we need to read data into a struct object_id from a pack or other unsigned char buffer. Add an inline function that does this based on the current hash algorithm in use, and use it in several places. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- resolve-undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resolve-undo.c') diff --git a/resolve-undo.c b/resolve-undo.c index aed95b4b35..fc5b3b83d9 100644 --- a/resolve-undo.c +++ b/resolve-undo.c @@ -90,7 +90,7 @@ struct string_list *resolve_undo_read(const char *data, unsigned long size) continue; if (size < rawsz) goto error; - memcpy(ui->oid[i].hash, (const unsigned char *)data, rawsz); + oidread(&ui->oid[i], (const unsigned char *)data); size -= rawsz; data += rawsz; } -- cgit v1.2.3