From: Rafael Silva Date: Thu, 26 Nov 2020 07:13:08 GMT Subject: Re: [PATCH 1/1] maintenance: fix a SEGFAULT when no repository Message-ID: <20201126071308.5237t54bxwueummg@contrib-buster.localdomain> In-Reply-To: <20201124191407.GC8396@szeder.dev> On Tue, Nov 24, 2020 at 08:14:07PM +0100, SZEDER Gábor wrote: > On Tue, Nov 24, 2020 at 12:24:57PM -0500, Eric Sunshine wrote: > > On Tue, Nov 24, 2020 at 11:45 AM Rafael Silva > > wrote: > > > diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh > > > @@ -441,4 +441,9 @@ test_expect_success 'register preserves existing strategy' ' > > > +test_expect_success 'run and start command fails when no git repository' ' > > > + test_must_fail git -C /tmp/ maintenance run && > > > + test_must_fail git -C /tmp/ maintenance start > > > +' > > > > I wouldn't feel comfortable relying upon existence of /tmp/. > > Indeed. > > > It might > > be sufficient to do this instead: > > > > mv .git save.git && > > test_when_finished "mv save.git .git" && > > test_must_fail git maintenance run && > > test_must_fail git maintenance start > > Our test library contains the 'nongit' helper function exactly for > this purpose: > > nongit test_must_fail git maintenance run && > nongit test_must_fail git maintenance start > I did not know that we have such a test helper and will definitely change on the next revision. Thank you.