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>
Ævar Arnfjörð Bjarmason committed
Oct 16, 2021 at 11:39 UTC
db7a3d25d639ba816fb85af3ca08d689702ab294
1 file changed
+3
-2
refs.c
+3
-2
@@ -1791,14 +1791,15 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
1791
{
1792
struct ref_store *refs;
1793
int flags;
1794
+ int ignore_errno;
1795
1796
refs = get_submodule_ref_store(submodule);
1797
1798
if (!refs)
1799
return -1;
1800
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))
1803
return -1;
1804
return 0;
1805
}