Skip to content

Commit db7a3d2

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 76887df commit db7a3d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

refs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,14 +1791,15 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
17911791
{
17921792
struct ref_store *refs;
17931793
int flags;
1794+
int ignore_errno;
17941795

17951796
refs = get_submodule_ref_store(submodule);
17961797

17971798
if (!refs)
17981799
return -1;
17991800

1800-
if (!refs_resolve_ref_unsafe(refs, refname, 0, oid, &flags) ||
1801-
is_null_oid(oid))
1801+
if (!refs_werrres_ref_unsafe(refs, refname, 0, oid, &flags,
1802+
&ignore_errno) || is_null_oid(oid))
18021803
return -1;
18031804
return 0;
18041805
}

0 commit comments

Comments
 (0)