Re: [PATCH/RFC] Have git-cvsserver call hooks/update before really altering the ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andy Parkins <andyparkins@xxxxxxxxx> writes:

> 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?

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]