From 21dbe53d39c584d3845aaac7fc9458e0654fc92e Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 29 May 2012 20:55:53 +0530 Subject: [PATCH] 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'. --- src/lib/Gitolite/Conf/Sugar.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/Gitolite/Conf/Sugar.pm b/src/lib/Gitolite/Conf/Sugar.pm index 06422b7..dca1c44 100644 --- a/src/lib/Gitolite/Conf/Sugar.pm +++ b/src/lib/Gitolite/Conf/Sugar.pm @@ -131,17 +131,17 @@ sub owner_desc { # -> config gitweb.description = some long description for my $line (@$lines) { - if ( $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; - } elsif ( $line =~ /^desc = (\S.*)/ ) { + if ( $line =~ /^desc = (\S.*)/ ) { push @ret, "config gitweb.description = $1"; } elsif ( $line =~ /^owner = (\S.*)/ ) { push @ret, "config gitweb.owner = $1"; } elsif ( $line =~ /^category = (\S.*)/ ) { 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 { push @ret, $line; }