From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [SQUASH 7/6] t/config: fix missing coderepo.<PROJECT>.dir entry
Date: Sun, 24 Sep 2023 09:50:44 +0000 [thread overview]
Message-ID: <20230924095044.M96800@dcvr> (raw)
In-Reply-To: <20230924054214.3539091-7-e@80x24.org>
Eric Wong <e@80x24.org> wrote:
> diff --git a/t/config.t b/t/config.t
> index 8a27a920..d567abd9 100644
> @@ -226,18 +230,16 @@ for my $s (@valid) {
> }
>
> {
> - my $pfx1 = "publicinbox.test1";
> - my $pfx2 = "publicinbox.test2";
> - my $str = <<EOF;
> -$pfx1.address=test\@example.com
> -$pfx1.inboxdir=/path/to/non/existent
> -$pfx2.address=foo\@example.com
> -$pfx2.inboxdir=/path/to/foo
> -$pfx1.coderepo=project
> -$pfx2.coderepo=project
> -coderepo.project.dir=/path/to/project.git
Oops, I forgot to translate the coderepo.project.dir line :x
> + my $cfg = cfg_new $tmpdir, <<EOF;
> +[publicinbox "test1"]
> + address = test\@example.com
> + inboxdir = /path/to/non/existent
> + coderepo = project
> +[publicinbox "test2"]
> + address = foo\@example.com
> + inboxdir = /path/to/foo
> + coderepo = project
> EOF
> - my $cfg = PublicInbox::Config->new(\$str);
> my $t1 = $cfg->lookup_name('test1');
> my $t2 = $cfg->lookup_name('test2');
> is($cfg->repo_objs($t1)->[0], $cfg->repo_objs($t2)->[0],
-----8<----
Subject: [SQUASH] t/config: fix missing coderepo.<PROJECT>.dir entry
Also added an extra check to ensure the coderepo's parsed
properly.
---
t/config.t | 3 +++
1 file changed, 3 insertions(+)
diff --git a/t/config.t b/t/config.t
index d567abd9..9b6684b7 100644
--- a/t/config.t
+++ b/t/config.t
@@ -239,9 +239,12 @@ for my $s (@valid) {
address = foo\@example.com
inboxdir = /path/to/foo
coderepo = project
+[coderepo "project"]
+ dir = /path/to/project.git
EOF
my $t1 = $cfg->lookup_name('test1');
my $t2 = $cfg->lookup_name('test2');
+ ok $cfg->repo_objs($t1)->[0], 'coderepo parsed';
is($cfg->repo_objs($t1)->[0], $cfg->repo_objs($t2)->[0],
'inboxes share ::Git object');
}
prev parent reply other threads:[~2023-09-24 9:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-24 5:42 [PATCH 0/6] lei config fixes and improvements Eric Wong
2023-09-24 5:42 ` [PATCH 1/6] lei: check git-config(1) failures Eric Wong
2023-09-24 5:42 ` [PATCH 2/6] lei view_text: used tied ProcessPipe for `git config' Eric Wong
2023-09-24 5:42 ` [PATCH 3/6] config: handle key-only entries as booleans Eric Wong
2023-09-24 5:42 ` [PATCH 4/6] lei config: send `git config' errors to pager Eric Wong
2023-09-24 5:42 ` [PATCH 5/6] lei: fix `-c NAME=VALUE' config support Eric Wong
2023-09-24 5:42 ` [PATCH 6/6] config: drop scalar ref support from internal API Eric Wong
2023-09-24 9:50 ` Eric Wong [this message]
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: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230924095044.M96800@dcvr \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/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.
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).