auth/compile: auto-vivify is default now, so:
the "create a new repo" code moves from compile to auth. Only someone who has W access can create it, but he can do so even on a "R" operation (like clone or ls-remote). This is a pre-requisite for rebel's wildcard repos, where autovivification is the only way you can create arbitrary repos matching a pattern. The only reason it's getting into master is because it looks cool! ---- OK that's a lie; the real reason is to keep the two branches as similar as possible, though they;ve diverged quite a bit since the "only one-line difference" days where "rebel" just meant "deny/exclude" rules!)
This commit is contained in:
parent
c3b5e3b1af
commit
b78a720cee
2 changed files with 14 additions and 16 deletions
|
@ -100,6 +100,15 @@ die "$perm access for $repo DENIED to $user\n"
|
|||
unless $repos{$repo}{$perm}{$user}
|
||||
or $repos{$repo}{$perm}{'@all'};
|
||||
|
||||
# create the repo if it doesn't already exist and the user has "W" access
|
||||
my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" );
|
||||
if ( ( $repos{$repo}{W}{$user}
|
||||
or $repos{$repo}{W}{'@all'} ) and not -d "$repo_base_abs/$repo.git" ) {
|
||||
wrap_chdir("$repo_base_abs");
|
||||
new_repo($repo, "$GL_ADMINDIR/src/hooks");
|
||||
wrap_chdir($ENV{HOME});
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# logging, timestamp. also setup env vars for later
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue