summaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorStefan Karpinski <stefan.karpinski@gmail.com>2009-01-29 13:58:02 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-30 21:11:46 -0800
commitad8c3477b890dfb125ac5ea8962f945f056674d7 (patch)
tree782ea15af7e9d6d9ef5b2110d9a69d1256d24f50 /git-cvsserver.perl
parent418566b6fdcc0eb1b5549d0742366aa13a7ff277 (diff)
downloadgit-ad8c3477b890dfb125ac5ea8962f945f056674d7.tar.gz
git-cvsserver: run post-update hook *after* update.
CVS server was running the hook before the update action was actually done. This performs the update before the hook is called. The original commit that introduced the current incorrect behavior was 394d66d "git-cvsserver runs hooks/post-update". The error in ordering of the hook call appears to have gone unnoticed, but since git-cvsserver is supposed to emulate receive-pack, it stands to reason that the hook should be run *after* the update. Since this behavior is inconsistent with recieve-pack, users are either: 1) not using post-update hooks with git-cvsserver; 2) using post-update hooks that don't care whether they are called before or after the actual update occurs; 3) using post-update hooks *only* with git-cvsserver, and relying on the hook being called just before the update. This patch would affect only users in case 3. These users are depending on fairly obviously wrong behavior, and moreover they can simply change their current post-update into post-recieve hooks, and their systems will work correctly again. Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 277ee4e477..ab6cea3e53 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1414,14 +1414,14 @@ sub req_ci
close $pipe || die "bad pipe: $! $?";
}
+ $updater->update();
+
### Then hooks/post-update
$hook = $ENV{GIT_DIR}.'hooks/post-update';
if (-x $hook) {
system($hook, "refs/heads/$state->{module}");
}
- $updater->update();
-
# foreach file specified on the command line ...
foreach my $filename ( @committedfiles )
{