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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
fe0a9eaf31
commit
69d124255e
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user