Re: [PATCH v6? 15/17] refs API: make resolve_ref_unsafe() not set errno
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Jul 13, 2021, 08:13 UTC
- Message-ID
- <CAFQ2z_MNEb=tb+iVjE3n33Lq8tfKNKnaMOvxm6z0cwXChbuSQA@mail.gmail.com>
- In-Reply-To
- <patch-15.17-446b50280be-20210711T162803Z-avarab@gmail.com>
On Sun, Jul 11, 2021 at 6:30 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 5 quoted lines
> + refs = get_main_ref_store(the_repository);
> + head = refs_resolve_ref_unsafe_with_errno(refs, "HEAD", 0, NULL, NULL,
> + &resolve_errno);
> + if (!head) {
> + errno = resolve_errno;This adds another place where we'd use global errno to communicate. Isn't there a die() function that takes an errno value explicitly?
-- 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