Re: [PATCH/RFC] Have git-cvsserver call hooks/update before really altering the ref
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 14, 2007, 05:36 UTC
- Message-ID
- <7v4pppuwpv.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <200702131512.45412.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 16 quoted lines
> diff --git a/git-cvsserver.perl b/git-cvsserver.perl
> index 9371788..b4ef6bc 100755
> --- a/git-cvsserver.perl
> +++ b/git-cvsserver.perl
> @@ -1171,6 +1171,21 @@ sub req_ci
> exit;
> }
>
> + # Check that this is allowed, just as we would with a receive-pack
> + my @cmd = ( $ENV{GIT_DIR}.'hooks/update', "refs/heads/$state->{module}",
> + $parenthash, $commithash );
> + if( -x $cmd[0] ) {
> + unless( system( @cmd ) == 0 )
> + {
> + $log->warn("Commit failed (update hook declined to update ref)");
> + print "error 2 Commit failed (update hook declined)\n";Everybody else seems to say 'print "error 1 blah blah"'. Are you sure "error 2 message" is Kosher protocol-wise?