refs: convert resolve_gitlink_ref to struct object_id
Convert the declaration and definition of resolve_gitlink_ref to use struct object_id and apply the following semantic patch: @@ expression E1, E2, E3; @@ - resolve_gitlink_ref(E1, E2, E3.hash) + resolve_gitlink_ref(E1, E2, &E3) @@ expression E1, E2, E3; @@ - resolve_gitlink_ref(E1, E2, E3->hash) + resolve_gitlink_ref(E1, E2, E3) 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
1053fe829c
commit
a98e6101f0
6
refs.c
6
refs.c
@ -1498,7 +1498,7 @@ const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
|
||||
}
|
||||
|
||||
int resolve_gitlink_ref(const char *submodule, const char *refname,
|
||||
unsigned char *sha1)
|
||||
struct object_id *oid)
|
||||
{
|
||||
struct ref_store *refs;
|
||||
int flags;
|
||||
@ -1508,8 +1508,8 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
|
||||
if (!refs)
|
||||
return -1;
|
||||
|
||||
if (!refs_resolve_ref_unsafe(refs, refname, 0, sha1, &flags) ||
|
||||
is_null_sha1(sha1))
|
||||
if (!refs_resolve_ref_unsafe(refs, refname, 0, oid->hash, &flags) ||
|
||||
is_null_oid(oid))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user