5 # this is hardcoded; change it if needed
11 # ----------------------------------------------------------------------
15 my $rb = `gitolite query-rc -n GL_REPO_BASE`;
24 try
"ADMIN_PUSH set1; !/FATAL/" or die text
();
29 # make the initial repo
30 glt ls-remote u1 file:///foo/u1/u1a;ok; gsh
31 /Initialized empty Git repository in .*/foo/u1/u1a.git/
32 # vrc doesn't have the fork command
33 glt fork u1 foo/u1/u1a foo/u1/u1a2; !ok; /FATAL: unknown git/gitolite command: \\'fork/
36 # allow fork as a valid command
37 $ENV{G3T_RC
} = "$ENV{HOME}/g3trc";
38 put
"$ENV{G3T_RC}", "\$rc{COMMANDS}{fork} = 1;\n";
40 # enable set-default-roles feature, add options, push
43 perl s/# 'set-default-roles'/'set-default-roles'/
46 try
"cd gitolite-admin";
51 option default.roles-1 = READERS @all
53 try
"ADMIN_PUSH set1; !/FATAL/" or die text
();
57 # now the fork succeeds
58 glt fork u1 foo/u1/u1a foo/u1/u1a2; ok; /Cloning into bare repository '.*/foo/u1/u1a2.git'/
59 /foo/u1/u1a forked to foo/u1/u1a2/
61 # now the actual testing starts
63 glt fork u1 foo/u1/u1c foo/u1/u1d; !ok; /'foo/u1/u1c' does not exist or you are not allowed to read it/
64 glt fork u2 foo/u1/u1a foo/u1/u1d; !ok; /'foo/u1/u1a' does not exist or you are not allowed to read it/
67 glt fork u1 foo/u1/u1a foo/u2/u1d; !ok; /'foo/u2/u1d' already exists or you are not allowed to create it/
70 glt fork u1 foo/u1/u1a foo/u1/u1e; ok; /Cloning into bare repository '.*/foo/u1/u1e.git'/
71 /warning: You appear to have cloned an empty repository/
72 /foo/u1/u1a forked to foo/u1/u1e/
74 glt fork u1 foo/u1/u1a foo/u1/u1e; !ok; /'foo/u1/u1e' already exists or you are not allowed to create it/
77 # now check the various files that should have been produced
80 try
"cd $rb; find . -name gl-perms"; $t = md5sum
(sort (lines
())); cmp $t,
81 '59b3a74b4d33c7631f08e75e7b60c7ce ./foo/u1/u1a2.git/gl-perms
82 59b3a74b4d33c7631f08e75e7b60c7ce ./foo/u1/u1e.git/gl-perms
85 try
"cd $rb; find . -name gl-creator"; $t = md5sum
(sort (lines
())); cmp $t,
86 'e4774cdda0793f86414e8b9140bb6db4 ./foo/u1/u1a.git/gl-creator
87 346955ff2eadbf76e19373f07dd370a9 ./foo/u1/u1a2.git/gl-creator
88 346955ff2eadbf76e19373f07dd370a9 ./foo/u1/u1e.git/gl-creator