make all the DENIED messages consistent

how did I not notice this before?
This commit is contained in:
Sitaram Chamarty 2011-10-18 08:03:05 +05:30
parent d750725a34
commit c553e393c3
7 changed files with 13 additions and 13 deletions

View file

@ -229,14 +229,14 @@ sub check_ref {
# refex? sure -- a regex to match a ref against :) # refex? sure -- a regex to match a ref against :)
next unless $ref =~ /^$refex/ or $ref eq 'joker'; next unless $ref =~ /^$refex/ or $ref eq 'joker';
# joker matches any refex; it will only ever be sent internally # joker matches any refex; it will only ever be sent internally
return "DENIED by $refex" if $ar->[2] eq '-' and $dry_run; return "$perm $ref $repo $ENV{GL_USER} DENIED by $refex" if $ar->[2] eq '-' and $dry_run;
die "$perm $ref $ENV{GL_USER} DENIED by $refex\n" if $ar->[2] eq '-'; 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 # as far as *this* ref is concerned we're ok
return $refex if ($ar->[2] =~ /\Q$perm/); return $refex if ($ar->[2] =~ /\Q$perm/);
} }
return "DENIED by fallthru" if $dry_run; return "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru" if $dry_run;
die "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru\n"; die "$perm $ref $repo $ENV{GL_USER} DENIED by fallthru\n";
} }
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------

View file

@ -82,7 +82,7 @@ runlocal git push -f origin master dev foo
name "u5 push master fail" name "u5 push master fail"
mdc mdc
runlocal git push u5:aa master 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 # u5 tries to rewind dev; succeeds
name "u5 rewind dev succeed" name "u5 rewind dev succeed"
@ -175,6 +175,6 @@ expect "\* \[new branch\] HEAD -> master"
runlocal git branch v1 runlocal git branch v1
runlocal git push origin v1 runlocal git push origin v1
name "deny rules -- push v1 fails" 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" name "INTERNAL"

View file

@ -45,6 +45,6 @@ mdc ufile; runlocal git push origin master
expect "To u1:abc" expect "To u1:abc"
expect "master -> master" expect "master -> master"
mdc ifile; runlocal git push origin 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 name INTERNAL

View file

@ -89,7 +89,7 @@ do
cd u2bar cd u2bar
mdc u2file1 mdc u2file1
runlocal git push 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 name INTERNAL
done done

View file

@ -42,7 +42,7 @@ do
runlocal git reset --hard HEAD^ runlocal git reset --hard HEAD^
mdc r1file4 mdc r1file4
runlocal git push origin +br1 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" expect "remote: error: hook declined to update refs/heads/br1"
name "u1 delete branch" name "u1 delete branch"

View file

@ -92,7 +92,7 @@ do
name "WRITERS cannot push a tag" name "WRITERS cannot push a tag"
git tag t2 HEAD^^ git tag t2 HEAD^^
runlocal git push u2:foo/u1/u1r1 t2 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: error: hook declined to update refs/tags/t2"
expect "\[remote rejected\] t2 -> t2 (hook declined)" expect "\[remote rejected\] t2 -> t2 (hook declined)"
expect "error: failed to push some refs to 'u2:foo/u1/u1r1'" expect "error: failed to push some refs to 'u2:foo/u1/u1r1'"

View file

@ -55,7 +55,7 @@ expect /tmp/rsyncbase/nitz/conf/gitolite.conf
name "u2 rsync to spl" name "u2 rsync to spl"
cd ~/gitolite-admin cd ~/gitolite-admin
runlocal rsync -avP conf u2:spl 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" name "u1 rsync to spl"
cd ~/gitolite-admin cd ~/gitolite-admin
@ -66,7 +66,7 @@ expect "total size is"
name "u2 rsync from spl" name "u2 rsync from spl"
cd ~/td cd ~/td
runlocal rsync -avP u2:spl splhere 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" name "u1 rsync from spl"
cd ~/td cd ~/td
@ -83,6 +83,6 @@ expect "total size is"
name "u3 rsync to bar" name "u3 rsync to bar"
cd ~/gitolite-admin cd ~/gitolite-admin
runlocal rsync -avP conf u3:bar 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" name "INTERNAL"