From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Mickey Endito <mickey.endito.2323@protonmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH] t5582: remove spurious 'cd "$D"' line
Date: Tue, 24 Aug 2021 20:59:42 +0200 [thread overview]
Message-ID: <20210824185942.GE2257957@szeder.dev> (raw)
In-Reply-To: <xmqq8s0rpwiw.fsf@gitster.g>
On Mon, Aug 23, 2021 at 04:32:39PM -0700, Junio C Hamano wrote:
> Mickey Endito <mickey.endito.2323@protonmail.com> writes:
>
> > The variable D is never defined in test t5582, more severely the test
> > fails if D is defined by something outside the test suite, so remove
> > this spurious line.
>
> Wow. Well spotted.
>
> When D is left unset, we end up executing
>
> cd "" && ...
>
> and it explains why nobody noticed the breakage for nearly a year
> since c0192df6 (refspec: add support for negative refspecs,
> 2020-09-30) was written.
>
>
> Unlike the apparent
> copy-and-paste source, this is a more modern script that limits the
> chdir inside subshells to avoid moving around in the main flow of
> the test, and the fix proposed here looks the most sensible.
'grep " cd $" test-results/*.out' shows that there is a similar case
in 't5323-pack-redundant.sh' as well, in test 'master: pack-redundant
works with no packfile'.
> > Signed-off-by: Mickey Endito <mickey.endito.2323@protonmail.com>
> > ---
> > To reproduce a failure do
> > D=/some/path/which/does/not/exist t/t5582-fetch-negative-refspec.sh
> >
> > Note: The variable D seems to be a reminiscent similar to t/t5510-fetch.sh,
> > which defines "D=$(pwd)". If you want to adopt that way, then you have
> > to code a fix yourself. ;-)
> >
> > t/t5582-fetch-negative-refspec.sh | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh
> > index e5d2e79ad3..7a80e47c2b 100755
> > --- a/t/t5582-fetch-negative-refspec.sh
> > +++ b/t/t5582-fetch-negative-refspec.sh
> > @@ -105,7 +105,6 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix"
> > '
> >
> > test_expect_success "fetch with negative refspec avoids duplicate conflict" '
> > - cd "$D" &&
> > (
> > cd one &&
> > git branch dups/a &&
> > --
> > 2.30.2
next prev parent reply other threads:[~2021-08-24 18:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 20:12 [PATCH] t5582: remove spurious 'cd "$D"' line Mickey Endito
2021-08-23 23:32 ` Junio C Hamano
2021-08-24 18:59 ` SZEDER Gábor [this message]
2021-08-24 21:10 ` Junio C Hamano
2021-08-25 1:35 ` Jeff King
2021-08-25 16:12 ` Junio C Hamano
2021-08-28 9:47 ` SZEDER Gábor
2021-08-30 16:42 ` Junio C Hamano
2021-08-30 18:58 ` Jeff King
2021-08-30 19:51 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210824185942.GE2257957@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
--cc=mickey.endito.2323@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).