mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Convert read_mmblob to take struct object_id.
Since all of its callers have been updated, convert read_mmblob to take a pointer to struct object_id. 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
e910bb1e79
commit
d449347d08
@@ -178,20 +178,20 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void read_mmblob(mmfile_t *ptr, const unsigned char *sha1)
|
||||
void read_mmblob(mmfile_t *ptr, const struct object_id *oid)
|
||||
{
|
||||
unsigned long size;
|
||||
enum object_type type;
|
||||
|
||||
if (!hashcmp(sha1, null_sha1)) {
|
||||
if (!oidcmp(oid, &null_oid)) {
|
||||
ptr->ptr = xstrdup("");
|
||||
ptr->size = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
ptr->ptr = read_sha1_file(sha1, &type, &size);
|
||||
ptr->ptr = read_sha1_file(oid->hash, &type, &size);
|
||||
if (!ptr->ptr || type != OBJ_BLOB)
|
||||
die("unable to read blob object %s", sha1_to_hex(sha1));
|
||||
die("unable to read blob object %s", oid_to_hex(oid));
|
||||
ptr->size = size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user