Convert lookup_replace_object to struct object_id

Convert both the argument and the return value to be pointers to struct
object_id.  Update the callers and their internals to deal with the new
type.  Remove several temporaries which are no longer needed.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2018-03-12 02:27:54 +00:00
committed by Junio C Hamano
parent b4f5aca40e
commit b383a13cc0
6 changed files with 42 additions and 59 deletions

View File

@ -24,14 +24,11 @@ static int verify_object(const struct object_id *oid, const char *expected_type)
enum object_type type;
unsigned long size;
void *buffer = read_object_file(oid, &type, &size);
const unsigned char *repl = lookup_replace_object(oid->hash);
const struct object_id *repl = lookup_replace_object(oid);
if (buffer) {
struct object_id reploid;
hashcpy(reploid.hash, repl);
if (type == type_from_string(expected_type))
ret = check_object_signature(&reploid, buffer, size, expected_type);
ret = check_object_signature(repl, buffer, size, expected_type);
free(buffer);
}
return ret;