summaryrefslogtreecommitdiffstats
path: root/t/invalid-refnames-filenames.t
blob: 19267fe99adf63875535d8b24410ed61a63d3040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/perl
use strict;
use warnings;

# this is hardcoded; change it if needed
use lib "src/lib";
use Gitolite::Test;

# invalid refnames
# ----------------------------------------------------------------------

try "plan 56";
try "DEF POK = !/DENIED/; !/failed to push/";

confreset; confadd '
    repo aa
        RW+                 =   @all
';

try "ADMIN_PUSH set1; !/FATAL/" or die text();

try "

cd ..
rm -rf aa
glt clone u1 file:///aa
cd aa
tc v-869

glt push u1 origin HEAD
        /To file:///aa/
        POK; /\\* \\[new branch\\]      HEAD -> master/

# push file aa,bb ok
tc  aa,bb
glt push u1 origin HEAD
        /To file:///aa/
        POK; /HEAD -> master/

# push file aa=bb ok
tc  aa=bb
glt push u1 origin HEAD
        /To file:///aa/
        POK; /HEAD -> master/

# push to branch dd,ee ok
glt push u1 origin master:dd,ee
        /To file:///aa/
        POK; /\\* \\[new branch\\]      master -> dd,ee/

# push to branch dd=ee fail
glt push u1 origin master:dd=ee
        /invalid characters in ref or filename: \\'refs/heads/dd=ee/
        reject
";

confreset; confadd '
    repo aa
        RW+                 =   @all
        RW+ NAME/           =   @all
';

try "ADMIN_PUSH set1; !/FATAL/" or die text();

try "

cd ..
rm -rf aa
glt clone u1 file:///aa
cd aa
tc  file-1

glt push u1 origin HEAD
        /To file:///aa/
        POK; /\\* \\[new branch\\]      HEAD -> master/

# push file aa,bb ok
tc  aa,bb
glt push u1 origin HEAD
        /To file:///aa/
        POK; /HEAD -> master/

# push file aa=bb fail
tc  aa=bb
glt push u1 origin HEAD
        /To file:///aa/
        POK; /HEAD -> master/

# push to branch dd,ee ok
git reset --hard HEAD^
tc  some-file
glt push u1 origin master:dd,ee
        /To file:///aa/
        POK; /\\* \\[new branch\\]      master -> dd,ee/

# push to branch dd=ee fail
glt push u1 origin master:dd=ee
        /invalid characters in ref or filename: \\'refs/heads/dd=ee/
        reject
";