info command simplified
(thanks to Eli for the back-and-forth that led to this)
This commit is contained in:
parent
ae75f9c938
commit
dfb9844dfb
5 changed files with 127 additions and 112 deletions
87
t/info.t
87
t/info.t
|
@ -9,7 +9,7 @@ use Gitolite::Test;
|
|||
# the info command
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
try 'plan 83';
|
||||
try 'plan 78';
|
||||
|
||||
try "## info";
|
||||
|
||||
|
@ -22,8 +22,12 @@ confreset;confadd '
|
|||
RW = u2
|
||||
R = u1
|
||||
repo t3
|
||||
RW = u3
|
||||
R = u4
|
||||
RW = u3
|
||||
R = u4
|
||||
|
||||
repo foo/..*
|
||||
C = u1
|
||||
RW = CREATOR u3
|
||||
';
|
||||
|
||||
try "ADMIN_PUSH info; !/FATAL/" or die text();
|
||||
|
@ -38,66 +42,67 @@ try "DEF GS = /hello %1, this is $ENV{USER}\\@.* running gitolite/";
|
|||
|
||||
try "
|
||||
glt info u1; ok; GS u1
|
||||
/R W \t\@t1/
|
||||
/R \tt2/
|
||||
/R W \ttesting/
|
||||
!/R W \tt3/
|
||||
glt info u2; ok; GS u2
|
||||
/R \t\@t1/
|
||||
/R W \tt2/
|
||||
/R W \ttesting/
|
||||
!/R W \tt3/
|
||||
glt info u3; ok; GS u3
|
||||
/R W \tt3/
|
||||
/R W \ttesting/
|
||||
!/R \t\@t1/
|
||||
!/R W \tt2/
|
||||
glt info u4; ok; GS u4
|
||||
/R \tt3/
|
||||
/R W \ttesting/
|
||||
!/R \t\@t1/
|
||||
!/R W \tt2/
|
||||
glt info u5; ok; GS u5
|
||||
/R W \ttesting/
|
||||
!/R \t\@t1/
|
||||
!/R W \tt2/
|
||||
!/R W \tt3/
|
||||
glt info u6; ok; GS u6
|
||||
/R W \ttesting/
|
||||
!/R \t\@t1/
|
||||
!/R W \tt2/
|
||||
!/R W \tt3/
|
||||
";
|
||||
|
||||
try "
|
||||
glt info u1 -p; ok; GS u1
|
||||
/C\tfoo/\\.\\.\\*/
|
||||
/R W *\tt1/
|
||||
/R *\tt2/
|
||||
/R W *\ttesting/
|
||||
!/R W *\tt3/
|
||||
glt info u2 -p; ok; GS u2
|
||||
glt info u2; ok; GS u2
|
||||
!/C\tfoo/
|
||||
/R *\tt1/
|
||||
/R W *\tt2/
|
||||
/R W *\ttesting/
|
||||
!/R W *\tt3/
|
||||
glt info u3 -p; ok; GS u3
|
||||
glt info u3; ok; GS u3
|
||||
/R W *\tt3/
|
||||
/R W *\ttesting/
|
||||
!/R *\tt1/
|
||||
!/R W *\tt2/
|
||||
glt info u4 -p; ok; GS u4
|
||||
glt info u4; ok; GS u4
|
||||
/R *\tt3/
|
||||
/R W *\ttesting/
|
||||
!/R *\tt1/
|
||||
!/R W *\tt2/
|
||||
glt info u5 -p; ok; GS u5
|
||||
glt info u5; ok; GS u5
|
||||
/R W *\ttesting/
|
||||
!/R *\tt1/
|
||||
!/R W *\tt2/
|
||||
!/R W *\tt3/
|
||||
glt info u6 -p; ok; GS u6
|
||||
glt info u6; ok; GS u6
|
||||
/R W *\ttesting/
|
||||
!/R *\tt1/
|
||||
!/R W *\tt2/
|
||||
!/R W *\tt3/
|
||||
";
|
||||
|
||||
try "
|
||||
glt ls-remote u1 file:///foo/one; ok
|
||||
glt info u1; ok; GS u1
|
||||
/C\tfoo/\\.\\.\\*/
|
||||
/R W *\tfoo/one/
|
||||
!/R W *\tfoo/one\tu1/
|
||||
glt info u2; ok; GS u2
|
||||
!/C\tfoo/
|
||||
!/R W *\tfoo/one/
|
||||
glt info u3; ok; GS u3
|
||||
!/C\tfoo/
|
||||
/R W *\tfoo/one/
|
||||
!/R W *\tfoo/one\tu1/
|
||||
";
|
||||
|
||||
try "
|
||||
glt ls-remote u1 file:///foo/one; ok
|
||||
glt info u1 -lc; ok; GS u1
|
||||
put
|
||||
/C\tfoo/\\.\\.\\*/
|
||||
!/C\tfoo.*u1/
|
||||
/R W *\tfoo/one\tu1/
|
||||
glt info u2 -lc; ok; GS u2
|
||||
put
|
||||
!/C\tfoo/
|
||||
!/R W *\tfoo/one/
|
||||
glt info u3 -lc; ok; GS u3
|
||||
put
|
||||
!/C\tfoo/
|
||||
/R W *\tfoo/one\tu1/
|
||||
";
|
||||
|
|
|
@ -33,20 +33,20 @@ try "
|
|||
glt ls-remote u1 file:///bar/u1/try1
|
||||
/Initialized empty Git repository in .*/bar/u1/try1.git//
|
||||
# default permissions for u2 and u4
|
||||
glt info u1 -p -lc
|
||||
glt info u1 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
glt info u2 -p -lc
|
||||
glt info u2 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
glt info u4 -p -lc
|
||||
glt info u4 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
|
||||
# \@leads can RW try1
|
||||
echo WRITERS \@leads | glt perms u1 bar/u1/try1; ok
|
||||
glt info u1 -p -lc
|
||||
glt info u1 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
glt info u2 -p -lc
|
||||
glt info u2 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
glt info u4 -p -lc
|
||||
glt info u4 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
|
||||
# \@devs can R try1
|
||||
|
@ -55,14 +55,14 @@ try "
|
|||
/READERS \@devs/
|
||||
!/WRITERS \@leads/
|
||||
|
||||
glt info u1 -p -lc
|
||||
glt info u1 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
|
||||
glt info u2 -p -lc
|
||||
glt info u2 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
/R *\tbar/u1/try1\tu1/
|
||||
|
||||
glt info u4 -p -lc
|
||||
glt info u4 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
/R *\tbar/u1/try1\tu1/
|
||||
|
||||
|
@ -71,11 +71,11 @@ try "
|
|||
glt perms u1 -l bar/u1/try1
|
||||
/READERS \@devs/
|
||||
/WRITERS \@leads/
|
||||
glt info u1 -p -lc
|
||||
glt info u1 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
glt info u2 -p -lc
|
||||
glt info u2 -lc
|
||||
/R W *\tbar/u1/try1\tu1/
|
||||
glt info u4 -p -lc
|
||||
glt info u4 -lc
|
||||
!/R W *\tbar/u1/try1\tu1/
|
||||
/R *\tbar/u1/try1\tu1/
|
||||
";
|
||||
|
|
|
@ -37,7 +37,7 @@ try "
|
|||
glt perms u1 -l foo/u1/bar
|
||||
/WRITERS u2/
|
||||
# expand
|
||||
glt info u2 -p
|
||||
glt info u2
|
||||
/R W *\tfoo/u1/bar/
|
||||
/R W *\ttesting/
|
||||
|
||||
|
@ -80,7 +80,7 @@ try "
|
|||
glt perms u1 -l foo/u1/bar
|
||||
/WRITERS u2/
|
||||
# expand
|
||||
glt info u2 -p
|
||||
glt info u2
|
||||
/R W *\tfoo/u1/bar/
|
||||
/R W *\ttesting/
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ confreset; confadd '
|
|||
try "ADMIN_PUSH set3; !/FATAL/" or die text();
|
||||
|
||||
try "
|
||||
ssh u1 info; ok; /R W \tfoo/
|
||||
ssh u2 info; ok; /R \tfoo/
|
||||
ssh u3 info; ok; /R W \tfoo/
|
||||
ssh u4 info; ok; /R \tfoo/
|
||||
ssh u1 info; ok; /R W\tfoo/
|
||||
ssh u2 info; ok; /R \tfoo/
|
||||
ssh u3 info; ok; /R W\tfoo/
|
||||
ssh u4 info; ok; /R \tfoo/
|
||||
ssh u5 info; ok; !/foo/
|
||||
ssh u6 info; ok; !/foo/
|
||||
"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue