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

Re: [PATCH v6? 08/17] refs file-backend.c: stop setting "EBUSY" in verify_lock()

From: Han-Wen Nienhuys <hidden>
Date: 2021-07-13 08:08:59

On Sun, Jul 11, 2021 at 6:30 PM Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
This EBUSY was set in 835e3c992fd (refs.c: verify_lock should set
errno to something meaningful, 2014-06-20) to fix a bug in code that
was later refactored in cd94f765720 (fetch.c: change s_update_ref to
use a ref transaction, 2014-04-28) to not use errno at all, the two
were a part of the same series.

So this was only ever needed for an intra-series bugfix, and we kept
it around for no reason. Removing it makes subsequent commits where we
refactor code surrounding verify_lock() (which may use errno) easier
to reason about.
diff --git a/refs/files-backend.c b/refs/files-backend.c
index a4e9344ac8b..abed0572fea 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -880,9 +880,7 @@ static int verify_lock(struct ref_store *ref_store, struct ref_lock *lock,
                               mustexist ? RESOLVE_REF_READING : 0,
                               &lock->old_oid, NULL)) {
                if (old_oid) {
-                       int save_errno = errno;
                        strbuf_addf(err, "can't verify ref '%s'", lock->ref_name);
-                       errno = save_errno;
your message talks about EBUSY, and that change looks good, but how
does it relate to this change?


-- 
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