diff --git a/src/gl-auth-command b/src/gl-auth-command index 31d1fa8..a135be6 100755 --- a/src/gl-auth-command +++ b/src/gl-auth-command @@ -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 # ---------------------------------------------------------------------------- diff --git a/src/gl-compile-conf b/src/gl-compile-conf index d939e5f..583a3f0 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -312,27 +312,12 @@ my $git_version = `git --version`; my ($gv_maj, $gv_min, $gv_patchrel) = ($git_version =~ m/git version (\d+)\.(\d+)\.(\d+)/); die "$ABRT I can't understand $git_version\n" unless ($gv_maj >= 1); $git_version = $gv_maj*10000 + $gv_min*100 + $gv_patchrel; # now it's "normalised" -my $git_too_old = 0; -# repo-base needs to be an absolute path for this loop to work right -# so if it was not already absolute, prefix $HOME. -my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" ); -wrap_chdir("$repo_base_abs"); -for my $repo (keys %repos) -{ - unless (-d "$repo.git") - { - new_repo($repo, "$GL_ADMINDIR/src/hooks"); - $git_too_old++ if $git_version < 10602; # that's 1.6.2 to you - # new_repo would have chdir'd us away; come back - wrap_chdir("$repo_base_abs"); - } -} warn "\n\t\t***** WARNING *****\n" . "\tyour git version is older than 1.6.2\n" . "\tgitolite will work but you MUST read the section on\n" . "\t\"git version dependency\" in doc/3-faq-tips-etc.mkd\n" - if $git_too_old; + if $git_version < 10602; # that's 1.6.2 to you # ---------------------------------------------------------------------------- # handle gitweb and daemon @@ -343,6 +328,10 @@ warn "\n\t\t***** WARNING *****\n" . # :-) These are now "pseduo users" -- giving them "R" access to a repo is all # you have to do +# repo-base needs to be an absolute path for this loop to work right +# so if it was not already absolute, prefix $HOME. +my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" ); + wrap_chdir("$repo_base_abs"); # daemons first...