aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-19 13:11:05 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-19 13:12:39 -0800
commit7e53607c95a7a44e603b907cd7e38b4ae17cc5d0 (patch)
tree39642b7c5e47b0a64b4768c9898e237c9c70d0d8
parentf5a92647694f18fb3544060a1a964ac082d072b2 (diff)
parentb2741f63d43a17ce9dafd1f97614bd6dbba72887 (diff)
downloadgit-7e53607c95a7a44e603b907cd7e38b4ae17cc5d0.tar.gz
git-7e53607c95a7a44e603b907cd7e38b4ae17cc5d0.tar.xz
Merge branch 'ap/cvsserver'
* ap/cvsserver: Have git-cvsserver call hooks/update before really altering the ref Acked-by: Martin Langhoff <martin@catalyst.net.nz>
-rwxr-xr-xgit-cvsserver.perl15
1 files changed, 15 insertions, 0 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 9371788fa..84520e7ad 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 1 Commit failed (update hook declined)\n";
+ close LOCKFILE;
+ unlink($lockfile);
+ chdir "/";
+ exit;
+ }
+ }
+
print LOCKFILE $commithash;
$updater->update();