Re: [PATCH v3 01/11] t2501: add various tests for removing the current working directory
- From
Elijah Newren <newren@gmail.com>
- Date
- Nov 27, 2021, 19:16 UTC
- Message-ID
- <CABPp-BEXghA4rZCx10hCWWNjtPLkMWXAXU6YNbA4JMZ8WmVPfA@mail.gmail.com>
- In-Reply-To
- <211127.864k7xj38p.gmgdl@evledraar.gmail.com>
On Sat, Nov 27, 2021 at 2:35 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 11 quoted lines
> > On Fri, Nov 26 2021, Elijah Newren via GitGitGadget wrote: > > > From: Elijah Newren <newren@gmail.com> > > > + # Although we want pwd & git status to pass, test for existing > > + # rather than desired behavior. > > + if [[ $works == "success" ]]; then > > Wasn't "[[" bash-specific or something? In any case a more regular "if > test "$works" = "success" would work here.
Thanks; will fix.
Show 5 quoted lines
> > + pwd -P && > > I wonder if this is doing what we want everywhere cf. 482e1488a9b > (t0001: fix broken not-quite getcwd(3) test in bed67874e2, 2021-07-30), > but haven't looked much/thought about it.
I can change to `test-tool getcwd` for the obscure platforms; thanks for the tip.
Show 21 quoted lines
> > +test_expect_success 'checkout does not clean cwd incidentally' ' > > + test_incidental_dir_removal failure git checkout init > > +' > > + > > +test_expect_success 'checkout fails if cwd needs to be removed' ' > > + test_required_dir_removal failure git checkout fd_conflict > > +' > > + > > +test_expect_success 'reset --hard does not clean cwd incidentally' ' > > + test_incidental_dir_removal failure git reset --hard init > > +' > > + > > +test_expect_success 'reset --hard fails if cwd needs to be removed' ' > > + test_required_dir_removal failure git reset --hard fd_conflict > > +' > > + > > +test_expect_success 'merge does not clean cwd incidentally' ' > > + test_incidental_dir_removal failure git merge reverted > > +' > > This testing the current behavior (and below) looks much better, thanks!
:-)