1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-13 19:16:28 +02:00

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>
This commit is contained in:
Johannes Schindelin 2006-07-26 22:51:52 +02:00 committed by Junio C Hamano
parent 5209eda863
commit cadbcf2712

View File

@ -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";