fix minor bug in handling 'desc = "some description"'

repo foo
        desc = "foo"
        RW  =   u1
        ...etc...

The order of the clauses was parsing this like the old 'reponame = "some
description"' and end up creating a repo called 'desc'!

It would also, as a side-effect, change the repo so what you thought
were access rules for 'foo' would become access rules for 'desc'.
This commit is contained in:
Sitaram Chamarty 2012-05-29 20:55:53 +05:30
parent 06d3398fb0
commit 21dbe53d39

View file

@ -131,17 +131,17 @@ sub owner_desc {
# -> config gitweb.description = some long description # -> config gitweb.description = some long description
for my $line (@$lines) { for my $line (@$lines) {
if ( $line =~ /^(\S+)(?: "(.*?)")? = "(.*)"$/ ) { if ( $line =~ /^desc = (\S.*)/ ) {
my ( $repo, $owner, $desc ) = ( $1, $2, $3 );
push @ret, "repo $repo";
push @ret, "config gitweb.description = $desc";
push @ret, "config gitweb.owner = $owner" if $owner;
} elsif ( $line =~ /^desc = (\S.*)/ ) {
push @ret, "config gitweb.description = $1"; push @ret, "config gitweb.description = $1";
} elsif ( $line =~ /^owner = (\S.*)/ ) { } elsif ( $line =~ /^owner = (\S.*)/ ) {
push @ret, "config gitweb.owner = $1"; push @ret, "config gitweb.owner = $1";
} elsif ( $line =~ /^category = (\S.*)/ ) { } elsif ( $line =~ /^category = (\S.*)/ ) {
push @ret, "config gitweb.category = $1"; push @ret, "config gitweb.category = $1";
} elsif ( $line =~ /^(\S+)(?: "(.*?)")? = "(.*)"$/ ) {
my ( $repo, $owner, $desc ) = ( $1, $2, $3 );
push @ret, "repo $repo";
push @ret, "config gitweb.description = $desc";
push @ret, "config gitweb.owner = $owner" if $owner;
} else { } else {
push @ret, $line; push @ret, $line;
} }