fix 'C' and 'M' tests in 'gitolite access'...
[gitolite.git] / t / reference.t
blobfefb5bca04606f2f117827cdda1c241ba59fd345
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 # this is hardcoded; change it if needed
6 use lib "src/lib";
7 use Gitolite::Test;
8 my $h = $ENV{HOME};
10 # fork command
11 # ----------------------------------------------------------------------
13 try "plan 16";
15 my $rb = `gitolite query-rc -n GL_REPO_BASE`;
17 try "sed -ie 's%.Mirroring.,%\"Mirroring\",\\n\"create-with-reference\",%' ~/.gitolite.rc";
19 confreset;confadd '
21 repo source
22 RW+ = u1 u2
24 repo fork
25 RW+ = u1 u2
26 option reference.repo = source
28 repo multifork
29 RW+ = u1 u2
30 option reference.repo-1 = source
31 option reference.repo-2 = fork
34 try "ADMIN_PUSH set1; !/FATAL/" or die text();
36 try " # Verify files
37 # source doesn't have alternates
38 ls $rb/source.git/objects/info/alternates; !ok
40 # fork has source as an alternate
41 ls $rb/fork.git/objects/info/alternates; ok
42 cat $rb/fork.git/objects/info/alternates; ok; /$rb/source.git/objects/
44 # multifork has multiple alternates
45 ls $rb/multifork.git/objects/info/alternates; ok
46 cat $rb/multifork.git/objects/info/alternates; ok; /$rb/source.git/objects/
47 /$rb/fork.git/objects/