namespace support; see http://sitaramc.github.com/gitolite/namespaces.html
This commit is contained in:
parent
b9bbb78278
commit
b0298618a3
5 changed files with 70 additions and 1 deletions
32
src/lib/Gitolite/Triggers/Namespaces.pm
Executable file
32
src/lib/Gitolite/Triggers/Namespaces.pm
Executable file
|
@ -0,0 +1,32 @@
|
|||
package Gitolite::Triggers::Namespaces;
|
||||
|
||||
use Gitolite::Rc;
|
||||
use Gitolite::Common;
|
||||
use Gitolite::Conf::Load;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# allow the server to use namespaces without the users needing to know
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# see http://sitaramc.github.com/gitolite/namespaces.html for instructions and
|
||||
# important warnings
|
||||
|
||||
sub pre_git {
|
||||
my $repo = $_[1];
|
||||
|
||||
my ($ns, $rr) = repo_namespace($repo);
|
||||
return if not $ns;
|
||||
|
||||
$ENV{GIT_NAMESPACE} = $ns;
|
||||
$rc{REALREPO} = $rr;
|
||||
trace( 1, "GIT_NAMESPACE = $ns, REALREPO = $rr");
|
||||
}
|
||||
|
||||
sub post_git {
|
||||
delete $ENV{GIT_NAMESPACE};
|
||||
}
|
||||
|
||||
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue