diff options
author | Eric Wong <e@80x24.org> | 2021-10-27 04:07:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-27 05:22:42 +0000 |
commit | ded9dad254c15aded6f8a1cf6b11e51e325b872d (patch) | |
tree | f2999c87159dea06d650c546c2d25d7335edcb49 /lib/PublicInbox/TestCommon.pm | |
parent | 694fc1b61b8f3c56e11f55f3413c1329b0b650da (diff) | |
download | public-inbox-ded9dad254c15aded6f8a1cf6b11e51e325b872d.tar.gz |
This lets users change their global init.defaultBranch config knob in ~/.gitconfig or similar without breaking tests. Reported-by: Thomas Weißschuh <thomas@t-8ch.de> Tested-by: Thomas Weißschuh <thomas@t-8ch.de>
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index fb0d5a4e..c3820d3a 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -674,8 +674,10 @@ sub create_inbox ($$;@) { my %opt = @_; require PublicInbox::Lock; require PublicInbox::InboxWritable; + require PublicInbox::Import; my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!); - my $dir = "t/data-gen/$base.$ident"; + my ($db) = (PublicInbox::Import::default_branch() =~ m!([^/]+)\z!); + my $dir = "t/data-gen/$base.$ident-$db"; my $new = !-d $dir; if ($new) { mkdir $dir; # may race |