refs: convert read_ref and read_ref_full to object_id
All but two of the call sites already have parameters using the hash parameter of struct object_id, so convert them to take a pointer to the struct directly. Also convert refs_read_refs_full, the underlying implementation. 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
0f2dc722dd
commit
34c290a6fc
@ -679,9 +679,9 @@ static int unresolve_one(const char *path)
|
||||
|
||||
static void read_head_pointers(void)
|
||||
{
|
||||
if (read_ref("HEAD", head_oid.hash))
|
||||
if (read_ref("HEAD", &head_oid))
|
||||
die("No HEAD -- no initial commit yet?");
|
||||
if (read_ref("MERGE_HEAD", merge_head_oid.hash)) {
|
||||
if (read_ref("MERGE_HEAD", &merge_head_oid)) {
|
||||
fprintf(stderr, "Not in the middle of a merge.\n");
|
||||
exit(0);
|
||||
}
|
||||
@ -721,7 +721,7 @@ static int do_reupdate(int ac, const char **av,
|
||||
PATHSPEC_PREFER_CWD,
|
||||
prefix, av + 1);
|
||||
|
||||
if (read_ref("HEAD", head_oid.hash))
|
||||
if (read_ref("HEAD", &head_oid))
|
||||
/* If there is no HEAD, that means it is an initial
|
||||
* commit. Update everything in the index.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user