5 # this is hardcoded; change it if needed
9 # branch permissions test
10 # ----------------------------------------------------------------------
30 try
"ADMIN_PUSH set1; !/FATAL/" or die text
();
34 glt clone u1 file:///aa; ok
36 tc l-995 l-996 l-997 l-998 l-999 l-1000 l-1001 l-1002 l-1003;
37 ok; /master a788db9. l-1003/
38 glt push u1 origin HEAD; ok; /To file:///aa/
39 /\\* \\[new branch\\] HEAD -> master/
44 # u1 rewind master succeed
45 git reset --hard HEAD^; ok; /HEAD is now at 65d5f4a l-1002/
46 tc v-865; ok; /master 3053bb4. v-865/
47 glt push u1 origin +master; ok; /\\+ a788db9...3053bb4 master -> master \\(forced update\\)/
49 # u2 rewind master fail
50 git reset --hard HEAD^; ok; /HEAD is now at 65d5f4a l-1002/
51 tc s-361; ok; /master b331651. s-361/
52 glt push u2 file:///aa +master; !ok; reject
53 /\\+ refs/heads/master aa u2 DENIED by fallthru/
55 # u3 rewind master succeed
56 git reset --hard HEAD^; ok
58 glt push u3 file:///aa +master; ok; /\\+ .* master -> master \\(forced update\\)/
60 # u4 push master succeed
62 glt push u4 file:///aa master; ok; /master -> master/
64 # u4 rewind master fail
65 git reset --hard HEAD^; ok;
66 glt push u4 file:///aa +master; !ok; /\\+ refs/heads/master aa u4 DENIED by fallthru/
68 # u3 and u4 / dev foo -- all 4 fail
69 glt push u3 file:///aa dev; !ok; /W refs/heads/dev aa u3 DENIED by fallthru/
70 glt push u4 file:///aa dev; !ok; /W refs/heads/dev aa u4 DENIED by fallthru/
71 glt push u3 file:///aa foo; !ok; /W refs/heads/foo aa u3 DENIED by fallthru/
72 glt push u4 file:///aa foo; !ok; /W refs/heads/foo aa u4 DENIED by fallthru/
74 # clean up for next set
75 glt push u1 -f origin master dev foo
80 glt push u5 file:///aa master; !ok; /W refs/heads/master aa u5 DENIED by refs/heads/master/
82 # u5 rewind dev succeed
83 glt push u5 file:///aa +dev^:dev
84 ok; /\\+ .* dev\\^ -> dev \\(forced update\\)/
87 glt push u5 file:///aa +foo^:foo
88 !ok; /\\+ refs/heads/foo aa u5 DENIED by fallthru/
90 # u5 tries to push foo; succeeds
91 git checkout foo; ok; /Switched to branch 'foo'/
95 glt push u5 file:///aa foo; ok; /foo -> foo/
97 # u1 delete branch dev succeed
98 glt push u1 origin :dev; ok; / - \\[deleted\\] *dev/
100 # quietly push it back again
101 glt push u1 origin dev; ok; / * \\[new branch\\] dev -> dev/
110 try
"ADMIN_PUSH set2; !/FATAL/" or die text
();
113 # u1 tries to delete dev on a new setup
114 cd ../aa; ok; /master -> master/
116 # u1 delete branch dev fail
117 glt push u1 origin :dev; !ok; /D refs/heads/dev aa u1 DENIED by fallthru/
119 # u4 delete branch dev succeed
120 glt push u4 file:///aa :dev; ok; / - \\[deleted\\] *dev/