3 # not part of the official test suite (yet); just some q&d testing
5 # to be run from ~/gitolite as ./$0
11 print2
() { echo -n "$@" >&3; }
12 say2
() { echo "$@" >&3; }
13 die
() { echo FATAL
: "$@" >&3; exit 1; }
16 export tmp
=$
(mktemp
-d)
23 echo "push @{ \$RC{ENABLE} }, 'refex-expr';" >> ~
/.gitolite.rc
24 cat <<EOF >> ~/.gitolite/conf/gitolite.conf
30 # u1 and u2 have some restrictions
34 # cant push versioned tags, but other tags are fine
35 - refs/tags/v[0-9] = u1 u2
36 # everything else is fine, but we need to recognise when they're pushing
37 # tags, so that the refex expr will have the correct info
38 RW+ refs/tags/ = u1 u2
41 # can push files in "foo/" only to a tag
42 RW+ VREF/NAME/foo/ = u1 u2
44 RW+ VREF/NAME/foo/ and refs/tags/ = u1 u2
45 - VREF/NAME/foo/ and not refs/tags/ = u1 u2
51 # ----------------------------------------------------------------------
53 # make sure u3 is not constrained in any way
55 git clone u3
:r9 refex-test.repo
73 # now test u1's constraints
76 rm -rf refex-test.repo
78 rm -rf ~
/repositories
/r9.git
81 git clone u1
:r9 refex-test.repo
87 # can push other branches
88 git push origin master
:m1
89 say2 master fail m1 pass
93 git push origin master
:m1
96 git push origin v1
&& die
2
99 # cant push foo/ to a branch
101 git push origin master
:m1
&& die
3
104 # but can push to a non-v-tag
107 say2 foo
/ non-v-tag pass