make all the DENIED messages consistent
how did I not notice this before?
This commit is contained in:
parent
d750725a34
commit
c553e393c3
|
@ -229,14 +229,14 @@ sub check_ref {
|
|||
# refex? sure -- a regex to match a ref against :)
|
||||
next unless $ref =~ /^$refex/ or $ref eq 'joker';
|
||||
# joker matches any refex; it will only ever be sent internally
|
||||
return "DENIED by $refex" if $ar->[2] eq '-' and $dry_run;
|
||||
die "$perm $ref $ENV{GL_USER} DENIED by $refex\n" if $ar->[2] eq '-';
|
||||
return "$perm $ref $repo $ENV{GL_USER} DENIED by $refex" if $ar->[2] eq '-' and $dry_run;
|
||||
die "$perm $ref $repo $ENV{GL_USER} DENIED by $refex\n" if $ar->[2] eq '-';
|
||||
|
||||
# as far as *this* ref is concerned we're ok
|
||||
return $refex if ($ar->[2] =~ /\Q$perm/);
|
||||
}
|
||||
return "DENIED by fallthru" if $dry_run;
|
||||
die "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru\n";
|
||||
return "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru" if $dry_run;
|
||||
die "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru\n";
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
@ -82,7 +82,7 @@ runlocal git push -f origin master dev foo
|
|||
name "u5 push master fail"
|
||||
mdc
|
||||
runlocal git push u5:aa master
|
||||
expect "remote: W refs/heads/master u5 DENIED by refs/heads/master"
|
||||
expect "remote: W refs/heads/master aa u5 DENIED by refs/heads/master"
|
||||
|
||||
# u5 tries to rewind dev; succeeds
|
||||
name "u5 rewind dev succeed"
|
||||
|
@ -175,6 +175,6 @@ expect "\* \[new branch\] HEAD -> master"
|
|||
runlocal git branch v1
|
||||
runlocal git push origin v1
|
||||
name "deny rules -- push v1 fails"
|
||||
expect "remote: W refs/heads/v1 tester DENIED by refs/heads/v\[0-9\]"
|
||||
expect "remote: W refs/heads/v1 r2 tester DENIED by refs/heads/v\[0-9\]"
|
||||
|
||||
name "INTERNAL"
|
||||
|
|
|
@ -45,6 +45,6 @@ mdc ufile; runlocal git push origin master
|
|||
expect "To u1:abc"
|
||||
expect "master -> master"
|
||||
mdc ifile; runlocal git push origin master
|
||||
expect "remote: W NAME/ifile u1 DENIED by NAME/i"
|
||||
expect "remote: W NAME/ifile abc u1 DENIED by NAME/i"
|
||||
|
||||
name INTERNAL
|
||||
|
|
|
@ -89,7 +89,7 @@ do
|
|||
cd u2bar
|
||||
mdc u2file1
|
||||
runlocal git push
|
||||
expect "remote: W refs/heads/master u2 DENIED by refs/.\*"
|
||||
expect "remote: W refs/heads/master foo/u1/bar u2 DENIED by refs/.\*"
|
||||
|
||||
name INTERNAL
|
||||
done
|
||||
|
|
|
@ -42,7 +42,7 @@ do
|
|||
runlocal git reset --hard HEAD^
|
||||
mdc r1file4
|
||||
runlocal git push origin +br1
|
||||
expect "remote: + refs/heads/br1 u1 DENIED by refs/"
|
||||
expect "remote: + refs/heads/br1 u1/r1 u1 DENIED by refs/"
|
||||
expect "remote: error: hook declined to update refs/heads/br1"
|
||||
|
||||
name "u1 delete branch"
|
||||
|
|
|
@ -92,7 +92,7 @@ do
|
|||
name "WRITERS cannot push a tag"
|
||||
git tag t2 HEAD^^
|
||||
runlocal git push u2:foo/u1/u1r1 t2
|
||||
expect "remote: W refs/tags/t2 u2 DENIED by refs/tags/"
|
||||
expect "remote: W refs/tags/t2 foo/u1/u1r1 u2 DENIED by refs/tags/"
|
||||
expect "remote: error: hook declined to update refs/tags/t2"
|
||||
expect "\[remote rejected\] t2 -> t2 (hook declined)"
|
||||
expect "error: failed to push some refs to 'u2:foo/u1/u1r1'"
|
||||
|
|
|
@ -55,7 +55,7 @@ expect /tmp/rsyncbase/nitz/conf/gitolite.conf
|
|||
name "u2 rsync to spl"
|
||||
cd ~/gitolite-admin
|
||||
runlocal rsync -avP conf u2:spl
|
||||
expect "W NAME/spl u2 DENIED by NAME/spl"
|
||||
expect "W NAME/spl EXTCMD/rsync u2 DENIED by NAME/spl"
|
||||
|
||||
name "u1 rsync to spl"
|
||||
cd ~/gitolite-admin
|
||||
|
@ -66,7 +66,7 @@ expect "total size is"
|
|||
name "u2 rsync from spl"
|
||||
cd ~/td
|
||||
runlocal rsync -avP u2:spl splhere
|
||||
expect "R NAME/spl u2 DENIED by NAME/spl"
|
||||
expect "R NAME/spl EXTCMD/rsync u2 DENIED by NAME/spl"
|
||||
|
||||
name "u1 rsync from spl"
|
||||
cd ~/td
|
||||
|
@ -83,6 +83,6 @@ expect "total size is"
|
|||
name "u3 rsync to bar"
|
||||
cd ~/gitolite-admin
|
||||
runlocal rsync -avP conf u3:bar
|
||||
expect "W NAME/bar u3 DENIED by fallthru"
|
||||
expect "W NAME/bar EXTCMD/rsync u3 DENIED by fallthru"
|
||||
|
||||
name "INTERNAL"
|
||||
|
|
Loading…
Reference in a new issue