keeping the profs at Cambridge happy...
[gitolite.git] / t / git-config.t
blob86a3a7b03a6c80474529ae0e4647ab8016a4587c
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;
9 # git config settings
10 # ----------------------------------------------------------------------
12 try "plan 57";
14 try "pwd";
15 my $od = text();
16 chomp($od);
18 my $t; # temp
20 # try an invalid config key
21 confreset;confadd '
23 repo @all
24 config foo.bar = dft
27 try "ADMIN_PUSH set1; /FATAL/" or die text();
28 try "
29 /git config \\'foo.bar\\' not allowed/
30 /check GIT_CONFIG_KEYS in the rc file/
33 # make foo.bar a valid gc key
34 $ENV{G3T_RC} = "$ENV{HOME}/g3trc";
35 put "$ENV{G3T_RC}", "\$rc{GIT_CONFIG_KEYS} = 'foo\.bar';\n";
37 confreset;confadd '
39 repo @all
40 config foo.bar = dft
42 repo gitolite-admin
43 RW+ = admin
44 config foo.bar =
46 repo testing
47 RW+ = @all
49 repo foo
50 RW = u1
51 config foo.bar = f1
53 repo frob
54 RW = u3
56 repo bar
57 RW = u2
58 config foo.bar = one
62 try "ADMIN_PUSH set1; !/FATAL/" or die text();
64 my $rb = `gitolite query-rc -n GL_REPO_BASE`;
65 try "
66 cd $rb; ok
67 egrep foo\\|bar *.git/config
69 $t = join("\n", sort (lines()));
71 cmp $t, 'bar.git/config: bar = one
72 bar.git/config: bare = true
73 bar.git/config:[foo]
74 foo.git/config: bar = f1
75 foo.git/config: bare = true
76 foo.git/config:[foo]
77 frob.git/config: bar = dft
78 frob.git/config: bare = true
79 frob.git/config:[foo]
80 gitolite-admin.git/config: bare = true
81 testing.git/config: bar = dft
82 testing.git/config: bare = true
83 testing.git/config:[foo]';
85 try "cd $od; ok";
87 confadd '
89 repo frob
90 RW = u3
91 config foo.bar = none
93 repo bar
94 RW = u2
95 config foo.bar = one
99 try "ADMIN_PUSH set1; !/FATAL/" or die text();
101 try "
102 cd $rb; ok
103 egrep foo\\|bar *.git/config
105 $t = join("\n", sort (lines()));
107 cmp $t, 'bar.git/config: bar = one
108 bar.git/config: bare = true
109 bar.git/config:[foo]
110 foo.git/config: bar = f1
111 foo.git/config: bare = true
112 foo.git/config:[foo]
113 frob.git/config: bar = none
114 frob.git/config: bare = true
115 frob.git/config:[foo]
116 gitolite-admin.git/config: bare = true
117 testing.git/config: bar = dft
118 testing.git/config: bare = true
119 testing.git/config:[foo]';
121 try "cd $od; ok";
123 confadd '
125 repo bar
126 RW = u2
127 config foo.bar =
131 try "ADMIN_PUSH set1; !/FATAL/" or die text();
133 try "
134 cd $rb; ok
135 egrep foo\\|bar *.git/config
137 $t = join("\n", sort (lines()));
139 cmp $t, 'bar.git/config: bare = true
140 bar.git/config:[foo]
141 foo.git/config: bar = f1
142 foo.git/config: bare = true
143 foo.git/config:[foo]
144 frob.git/config: bar = none
145 frob.git/config: bare = true
146 frob.git/config:[foo]
147 gitolite-admin.git/config: bare = true
148 testing.git/config: bar = dft
149 testing.git/config: bare = true
150 testing.git/config:[foo]';
152 try "cd $od; ok";
154 confreset;confadd '
156 repo @gr1
157 RW = u1
158 config foo.bar = f1
160 repo bar/CREATOR/[one].*
161 C = u2
162 RW = u2
163 config foo.bar = one
165 @gr1 = foo frob
168 try "ADMIN_PUSH set1; !/FATAL/" or die text();
169 try "
170 glt ls-remote u2 file:///bar/u2/one; ok; /Initialized empty/
171 glt ls-remote u2 file:///bar/u2/two; !ok; /DENIED by fallthru/
174 try "
175 cd $rb; ok
176 find . -name config | xargs egrep foo\\|bar
178 $t = join("\n", sort (lines()));
180 cmp $t, './bar/u2/one.git/config: bar = one
181 ./bar/u2/one.git/config: bare = true
182 ./bar/u2/one.git/config:[foo]
183 ./foo.git/config: bar = f1
184 ./foo.git/config: bare = true
185 ./foo.git/config:[foo]
186 ./frob.git/config: bar = f1
187 ./frob.git/config: bare = true
188 ./frob.git/config:[foo]
189 ./gitolite-admin.git/config: bare = true
190 ./testing.git/config: bar = dft
191 ./testing.git/config: bare = true
192 ./testing.git/config:[foo]';