Re: [PATCH 08/11] t4207: delete replace references via git-update-ref(1)
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Oct 18, 2023, 13:27 UTC
- Message-ID
- <CAFQ2z_MiOazk8qLvEn5xfHyMwY=5pa6rEJD3vC3+rnHz4AeQ2Q@mail.gmail.com>
- In-Reply-To
- <c4d09e3e5dbd11221cc4d229b815434d441cdb4d.1697607222.git.ps@pks.im>
On Wed, Oct 18, 2023 at 7:35 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 13 quoted lines
> > In t4207 we set up a set of replace objects via git-replace(1). Because > these references should not be impacting subsequent tests we also set up > some cleanup logic that deletes the replacement references via a call to > `rm -rf`. This reaches into the internal implementation details of the > reference backend and will thus break when we grow an alternative refdb > implementation. > > Refactor the tests to delete the replacement refs via Git commands so > that we become independent of the actual refdb that's in use. As we > don't have a nice way to delete all replacements or all references in a > certain namespace, we opt for a combination of git-for-each-ref(1) and > git-update-ref(1)'s `--stdin` mode.
There is a test helper that can directly access the ref database, t/helper/test-ref-store.c.
If you use that manipulate refs for testing purposes, you make the test independent of behavior git-for-each-ref/git-update-ref, which is what you want for testing replace-objects?
-- 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, Liana Sebastian