Thread (44 messages) 44 messages, 2 authors, 2021-10-16
STALE1684d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 09/21] refs API: make resolve_gitlink_ref() not set errno

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-10-16 09:40:34
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 refs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 80b85d244d2..dc6ed561492 100644
--- a/refs.c
+++ b/refs.c
@@ -1791,14 +1791,15 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
 {
 	struct ref_store *refs;
 	int flags;
+	int ignore_errno;
 
 	refs = get_submodule_ref_store(submodule);
 
 	if (!refs)
 		return -1;
 
-	if (!refs_resolve_ref_unsafe(refs, refname, 0, oid, &flags) ||
-	    is_null_oid(oid))
+	if (!refs_werrres_ref_unsafe(refs, refname, 0, oid, &flags,
+				     &ignore_errno) || is_null_oid(oid))
 		return -1;
 	return 0;
 }
-- 
2.33.1.1338.g20da966911a
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help