diff --git a/src/gitolite.pm b/src/gitolite.pm index 1d98fe7..9d76f8c 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -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"; } # ---------------------------------------------------------------------------- diff --git a/t/t03a-branch-permissions b/t/t03a-branch-permissions index 39dd8ab..1495250 100644 --- a/t/t03a-branch-permissions +++ b/t/t03a-branch-permissions @@ -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" diff --git a/t/t09a-oldtests b/t/t09a-oldtests index e301da1..cabfe0c 100644 --- a/t/t09a-oldtests +++ b/t/t09a-oldtests @@ -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 diff --git a/t/t50-sequence-test b/t/t50-sequence-test index 528796a..2950fa9 100644 --- a/t/t50-sequence-test +++ b/t/t50-sequence-test @@ -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 diff --git a/t/t62-rule-sequences b/t/t62-rule-sequences index e4da9fe..6321d7d 100644 --- a/t/t62-rule-sequences +++ b/t/t62-rule-sequences @@ -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" diff --git a/t/t63-perm-cats b/t/t63-perm-cats index 257478c..3565bfa 100644 --- a/t/t63-perm-cats +++ b/t/t63-perm-cats @@ -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'" diff --git a/t/t65-rsync b/t/t65-rsync index 153d31f..c22a6ec 100644 --- a/t/t65-rsync +++ b/t/t65-rsync @@ -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"