diff --git a/src/Gitolite/Test.pm b/src/Gitolite/Test.pm index f7b4544..e78fe88 100644 --- a/src/Gitolite/Test.pm +++ b/src/Gitolite/Test.pm @@ -9,12 +9,16 @@ package Gitolite::Test; put text dump + confreset + confadd ); #>>> use Exporter 'import'; use File::Path qw(mkpath); use Carp qw(carp cluck croak confess); +use Gitolite::Common; + BEGIN { require Gitolite::Test::Tsh; *{'try'} = \&Tsh::try; @@ -65,4 +69,25 @@ sub dump { } } +sub _confargs { + return @_ if ($_[1]); + return 'gitolite.conf', $_[0]; +} + +sub confreset { + system("rm", "-rf", "conf"); + mkdir("conf"); + put "conf/gitolite.conf", ' + repo gitolite-admin + RW+ = admin + repo testing + RW+ = @all +'; +} + +sub confadd { + my ($file, $string) = _confargs(@_); + put "|cat >> conf/$file", $string; +} + 1;