This is now the default for playtree_setup. The caller can simply set
it explicitly.
We make this part of a new :playground export tag for Dgit.pm,
which is going to gain other bits shortly.
And, we add some comments, and move the global; more code and
commentary will appear around this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
changedir git_slurp_config_src
playtree_setup);
# implicitly uses $main::us
changedir git_slurp_config_src
playtree_setup);
# implicitly uses $main::us
- %EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO NOCOMMITCHECK)] );
- @EXPORT_OK = @{ $EXPORT_TAGS{policyflags} };
+ %EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO NOCOMMITCHECK)],
+ playground => [qw($local_git_cfg)]);
+ @EXPORT_OK = ( @{ $EXPORT_TAGS{policyflags} },
+ @{ $EXPORT_TAGS{playground} } );
-sub playtree_setup ($) {
- # for use in the playtree
+# ========== playground handling ==========
+
+# $local_git_cfg hash of arrays of values: git config from $maindir
+
+our $local_git_cfg;
+
+# ----- playtrees -----
+
+sub playtree_setup (;$) {
my ($t_local_git_cfg) = @_;
my ($t_local_git_cfg) = @_;
+ $t_local_git_cfg //= $local_git_cfg;
# should be run in a directory .git/FOO/BAR of a working tree
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);
# should be run in a directory .git/FOO/BAR of a working tree
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);