git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Jiang Xin <zhiyou.jx@alibaba-inc.com>,
	Junio C Hamano <gitster@pobox.com>,
	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 21:35:52 -0400	[thread overview]
Message-ID: <YSWeeEgzCCT/3kxR@coredump.intra.peff.net> (raw)
In-Reply-To: <20210824185942.GE2257957@szeder.dev>

On Tue, Aug 24, 2021 at 08:59:42PM +0200, SZEDER Gábor wrote:

> > 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'.

Hmm. I think that one is different, in that the "cd" is not redundant,
but wrong. But it turns out not to matter to the test. ;)

-- >8 --
Subject: [PATCH] t5323: drop mentions of "master"

Commit 0696232390 (pack-redundant: fix crash when one packfile in repo,
2020-12-16) added one some new tests to t5323. At the time, the sub-repo
we used was called "master". But in a parallel branch, this was switched
to "main".

When the latter branch was merged in 27d7c8599b (Merge branch
'js/default-branch-name-tests-final-stretch', 2021-01-25), some of those
spots caused textual conflicts, but some (for tests that were far enough
away from other changed code) were just semantic. The merge resolution
fixed up most spots, but missed this one.

Even though this did impact actual code, it turned out not to fail the
tests. Running 'cd "$master_repo"' ended up staying in the same
directory, running the test in the main trash repo instead of the
sub-repo. But because the point of the test is checking behavior when
there are no packfiles, it worked in either repo (since both are empty
at this point in the script).

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5323-pack-redundant.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 8b01793845..8dbbcc5e51 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -114,9 +114,9 @@ test_expect_success 'setup main repo' '
 	create_commits_in "$main_repo" A B C D E F G H I J K L M N O P Q R
 '
 
-test_expect_success 'master: pack-redundant works with no packfile' '
+test_expect_success 'main: pack-redundant works with no packfile' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			fatal: Zero packs found!
 			EOF
-- 
2.33.0.394.gce7abe507a


  parent reply	other threads:[~2021-08-25  1:36 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
2021-08-24 21:10     ` Junio C Hamano
2021-08-25  1:35     ` Jeff King [this message]
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=YSWeeEgzCCT/3kxR@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=mickey.endito.2323@protonmail.com \
    --cc=szeder.dev@gmail.com \
    --cc=zhiyou.jx@alibaba-inc.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).