summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-07-26 22:51:52 +0200
committerJunio C Hamano <junkio@cox.net>2006-07-26 14:32:13 -0700
commitcadbcf2712ff346dcd757d0b116359380920b2a4 (patch)
treefb3c4a588b61992303a6ceebbd151c7744ffa4f1
parent5209eda86363a3ba2e000903ad8de29589b18b58 (diff)
downloadgit-cadbcf2712ff346dcd757d0b116359380920b2a4.tar.gz
cvsserver: imitate git-update-ref when committing
git-update-ref writes into the lockfile, and renames it afterwards. Like commit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared setups: every developer can have a different primary group; what matters is that $GIT_DIR/refs/heads has to be writable by a group you are in. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-cvsserver.perl8
1 files changed, 4 insertions, 4 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 5b73837bb1..2130d57020 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1142,9 +1142,7 @@ sub req_ci
exit;
}
- open FILE, ">", "$ENV{GIT_DIR}refs/heads/$state->{module}";
- print FILE $commithash;
- close FILE;
+ print LOCKFILE $commithash;
$updater->update();
@@ -1171,7 +1169,9 @@ sub req_ci
}
close LOCKFILE;
- unlink($lockfile);
+ my $reffile = "$ENV{GIT_DIR}refs/heads/$state->{module}";
+ unlink($reffile);
+ rename($lockfile, $reffile);
chdir "/";
print "ok\n";