gitweb: Use the config file to set repository owner's name.

Now gitweb checks if gitweb.owner exists before trying to get filesystem's
owner.

Allow to use configuration variable gitweb.owner set the repository owner,
it checks the gitweb.owner, if not set it uses filesystem directory's owner.

Useful when we don't want to maintain project list file, and all
repository directories have to have the same owner (for example when the
same SSH account is shared for all projects, using ssh_acl to control
access instead).

Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Bruno Ribas
2008-02-08 14:38:04 -02:00
committed by Junio C Hamano
parent 053d9e432b
commit b59012ef4e
2 changed files with 9 additions and 1 deletions

View File

@ -1759,6 +1759,7 @@ sub git_get_project_owner {
my $owner;
return undef unless $project;
$git_dir = "$projectroot/$project";
if (!defined $gitweb_project_owner) {
git_get_project_list_from_file();
@ -1767,8 +1768,11 @@ sub git_get_project_owner {
if (exists $gitweb_project_owner->{$project}) {
$owner = $gitweb_project_owner->{$project};
}
if (!defined $owner){
$owner = git_get_project_config('owner');
}
if (!defined $owner) {
$owner = get_file_owner("$projectroot/$project");
$owner = get_file_owner("$git_dir");
}
return $owner;