3
# update git-config entries in each repo
4
# ----------------------------------------------------------------------
8
use lib $ENV{GL_LIBDIR};
11
use Gitolite::Conf::Load;
16
my $RB = $rc{GL_REPO_BASE};
19
# ----------------------------------------------------------------------
20
# skip if arg-0 is POST_CREATE and no arg-2 (user name) exists; this means
21
# it's been triggered by a *normal* (not "wild") repo creation, which in turn
22
# means a POST_COMPILE should be following so there's no need to waste time
23
# running this once for each new repo
24
exit 0 if @ARGV and $ARGV[0] eq 'POST_CREATE' and not $ARGV[2];
26
# ----------------------------------------------------------------------
27
# if called from POST_CREATE, we have only a single repo to worry about
28
if (@ARGV and $ARGV[0] eq 'POST_CREATE') {
35
# ----------------------------------------------------------------------
36
# else it's all repos (i.e., called from POST_COMPILE)
38
my $lpr = list_phy_repos();
46
my $creator = creator($pr);
48
my $gc = git_config( $pr, '.', 1 );
49
while ( my ( $key, $value ) = each( %{$gc} ) ) {
50
next if $key =~ /^gitolite-options\./;
52
while ( my ($mk, $mv) = each %{ $rc{SAFE_CONFIG} } ) {
53
$value =~ s/%$mk/$mv/g;
55
system( "git", "config", "--file", "$RB/$pr.git/config", $key, $value );
57
system( "git", "config", "--file", "$RB/$pr.git/config", "--unset-all", $key );