Thread (135 messages) 135 messages, 4 authors, 2021-08-23

Re: [PATCH 6/8] refs: clear errno return in refs_resolve_ref_unsafe()

From: Han-Wen Nienhuys <hidden>
Date: 2021-06-10 11:46:12

On Thu, Jun 3, 2021 at 4:53 AM Jonathan Tan [off-list ref] wrote:
quoted
@@ -1685,10 +1685,11 @@ int refs_read_raw_ref(struct ref_store *ref_store, const char *refname,
 }

 /* This function needs to return a meaningful errno on failure */
-const char *refs_resolve_ref_unsafe(struct ref_store *refs,
-                                 const char *refname,
-                                 int resolve_flags,
-                                 struct object_id *oid, int *flags)
+static const char *refs_resolve_ref_unsafe_errno(struct ref_store *refs,
+                                              const char *refname,
+                                              int resolve_flags,
+                                              struct object_id *oid,
+                                              int *flags)
So a third function (refs_resolve_ref_unsafe_errno() - not to be
confused with refs_resolve_ref_unsafe_with_errno(), which has an extra
"with")? Couldn't we just swap the other 2 functions directly instead of
going through this intermediary?
I've clarified the name. I've done it this way, because it keeps the
diff small. Swapping the functions would require code changes that I
thought would be more work to review.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help