X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=git-cvsserver.perl;h=84520e7ad5c1745b14db2206189bb7d54c17dcc8;hb=50cfde14531a5b354bbc3a070fe39c1ee86e2915;hp=a33a876ff652fea5a0a8933b919982557a7093de;hpb=1fcdd62adf81a172f45c7c6a58177212d500b9d9;p=git.git diff --git a/git-cvsserver.perl b/git-cvsserver.perl index a33a876ff..84520e7ad 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -172,11 +172,11 @@ sub req_Root return 0; } - my @gitvars = `git-repo-config -l`; + my @gitvars = `git-config -l`; if ($?) { - print "E problems executing git-repo-config on the server -- this is not a git repository or the PATH is not set correctly.\n"; + print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n"; print "E \n"; - print "error 1 - problem executing git-repo-config\n"; + print "error 1 - problem executing git-config\n"; return 0; } foreach my $line ( @gitvars ) @@ -876,9 +876,9 @@ sub req_update print "MT newline\n"; next; } - elsif ( !defined($wrev) || $wrev == 0 ) + elsif ( (!defined($wrev) || $wrev == 0) && (!defined($meta->{revision}) || $meta->{revision} == 0) ) { - $log->info("Tell the client the file will be added"); + $log->info("Tell the client the file is scheduled for addition"); print "MT text A \n"; print "MT fname $filename\n"; print "MT newline\n"; @@ -886,7 +886,7 @@ sub req_update } else { - $log->info("Updating '$filename' $wrev"); + $log->info("Updating '$filename' to ".$meta->{revision}); print "MT +updated\n"; print "MT text U \n"; print "MT fname $filename\n"; @@ -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 1 Commit failed (update hook declined)\n"; + close LOCKFILE; + unlink($lockfile); + chdir "/"; + exit; + } + } + print LOCKFILE $commithash; $updater->update();