fix accumulation of 'config' (git config) lines
If a repo matches multiple patterns, 'config' lines were being picked up only from one of the 'repo' paras, instead of from all applicable ones.
This commit is contained in:
parent
4c1e4b2b1a
commit
0b68365860
3 changed files with 48 additions and 3 deletions
|
@ -644,13 +644,18 @@ sub parse_acl
|
|||
# the old "convenience copy" thing. Now on steroids :)
|
||||
|
||||
# note that when copying the @all entry, we retain the destination name as
|
||||
# @all; we dont change it to $repo or $gl_user
|
||||
# @all; we dont change it to $repo or $gl_user. We need to maintain this
|
||||
# distinction to be able to print the @/#/& prefixes in the report output
|
||||
# (see doc/report-output.mkd)
|
||||
for my $r ('@all', @repo_plus) {
|
||||
my $dr = $repo; $dr = '@all' if $r eq '@all';
|
||||
$repos{$dr}{DELETE_IS_D} = 1 if $repos{$r}{DELETE_IS_D};
|
||||
$repos{$dr}{CREATE_IS_C} = 1 if $repos{$r}{CREATE_IS_C};
|
||||
$repos{$dr}{NAME_LIMITS} = 1 if $repos{$r}{NAME_LIMITS};
|
||||
$git_configs{$dr} = $git_configs{$r} if $git_configs{$r};
|
||||
# this needs to copy the key-value pairs from RHS to LHS, not just
|
||||
# assign RHS to LHS! However, we want to roll in '@all' configs also
|
||||
# into the actual $repo; there's no need to preserve the distinction
|
||||
map { $git_configs{$repo}{$_} = $git_configs{$r}{$_} } keys %{$git_configs{$r}} if $git_configs{$r};
|
||||
|
||||
for my $u ('@all', "$gl_user - wild", @user_plus, keys %perm_cats) {
|
||||
my $du = $gl_user; $du = '@all' if $u eq '@all' or ($perm_cats{$u} || '') eq '@all';
|
||||
|
|
|
@ -245,6 +245,11 @@ sub parse_conf_line
|
|||
for my $repo (@{ $repos_p }) # each repo in the current stanza
|
||||
{
|
||||
$git_configs{$repo}{$key} = $value;
|
||||
|
||||
# force entry in %repos. Without this, a repo para with just a
|
||||
# config line and no ACLs gets ignored in the output
|
||||
$repos{$repo}{HAS_CONFIG} = 1;
|
||||
|
||||
# no problem if it's a plain repo (non-pattern, non-groupname)
|
||||
# OR wild configs are allowed
|
||||
unless ( ($repo =~ $REPONAME_PATT and $repo !~ /^@/) or $GL_GITCONFIG_WILD) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue