diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2017-04-14 15:05:51 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2017-04-15 10:09:17 +0530 |
commit | d6e8a0f51b26d0ef3119104075ef7b2a86b50f46 (patch) | |
tree | eda3aeb82aa4fa91c2e1462653a3ad26239f1b15 /src | |
parent | d0b1733f537fede028bc569ee602b4db295f85a4 (diff) |
new 'skip_block' sugar, and 'testconf' feature using it
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Gitolite/Conf/Sugar.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/Gitolite/Conf/Sugar.pm b/src/lib/Gitolite/Conf/Sugar.pm index 986494b..68ad728 100644 --- a/src/lib/Gitolite/Conf/Sugar.pm +++ b/src/lib/Gitolite/Conf/Sugar.pm @@ -68,6 +68,7 @@ sub sugar { $lines = owner_desc($lines); $lines = name_vref($lines); $lines = role_names($lines); + $lines = skip_block($lines); return $lines; } @@ -179,5 +180,21 @@ sub role_names { return \@ret; } +sub skip_block { + my $lines = shift; + + my @out = (); + for (@$lines) { + my $skip = 0; + $skip = 1 if /^= *begin testconf$/; + # add code for other types of blocks here as needed + + next if $skip .. /^= *end$/; + push @out, $_; + } + + return \@out; +} + 1; |