refs API: make resolve_gitlink_ref() not set errno
I have carefully read the upstream callers of resolve_gitlink_ref() and determined that they don't care about errno. So let's move away from the errno-setting refs_resolve_ref_unsafe() wrapper to refs_werrres_ref_unsafe(), and explicitly ignore the errno it sets for us. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
76887df014
commit
db7a3d25d6
5
refs.c
5
refs.c
@ -1791,14 +1791,15 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
|
|||||||
{
|
{
|
||||||
struct ref_store *refs;
|
struct ref_store *refs;
|
||||||
int flags;
|
int flags;
|
||||||
|
int ignore_errno;
|
||||||
|
|
||||||
refs = get_submodule_ref_store(submodule);
|
refs = get_submodule_ref_store(submodule);
|
||||||
|
|
||||||
if (!refs)
|
if (!refs)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!refs_resolve_ref_unsafe(refs, refname, 0, oid, &flags) ||
|
if (!refs_werrres_ref_unsafe(refs, refname, 0, oid, &flags,
|
||||||
is_null_oid(oid))
|
&ignore_errno) || is_null_oid(oid))
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user