sha1_file: convert read_object_with_reference to object_id

Convert read_object_with_reference to take pointers to struct object_id.
Update the internals of the function accordingly.

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:52 +00:00
committed by Junio C Hamano
parent 916bc35b29
commit 02f0547eaa
7 changed files with 28 additions and 28 deletions

View File

@ -2583,8 +2583,9 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
oidcpy(&commit_oid, &commit_oe->idx.oid);
} else if (!get_oid(p, &commit_oid)) {
unsigned long size;
char *buf = read_object_with_reference(commit_oid.hash,
commit_type, &size, commit_oid.hash);
char *buf = read_object_with_reference(&commit_oid,
commit_type, &size,
&commit_oid);
if (!buf || size < 46)
die("Not a valid commit: %s", p);
free(buf);
@ -2653,9 +2654,8 @@ static void parse_from_existing(struct branch *b)
unsigned long size;
char *buf;
buf = read_object_with_reference(b->oid.hash,
commit_type, &size,
b->oid.hash);
buf = read_object_with_reference(&b->oid, commit_type, &size,
&b->oid);
parse_from_commit(b, buf, size);
free(buf);
}
@ -2732,8 +2732,9 @@ static struct hash_list *parse_merge(unsigned int *count)
oidcpy(&n->oid, &oe->idx.oid);
} else if (!get_oid(from, &n->oid)) {
unsigned long size;
char *buf = read_object_with_reference(n->oid.hash,
commit_type, &size, n->oid.hash);
char *buf = read_object_with_reference(&n->oid,
commit_type,
&size, &n->oid);
if (!buf || size < 46)
die("Not a valid commit: %s", from);
free(buf);