Skip to content

Commit

Permalink
cvsserver: imitate git-update-ref when committing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jul 26, 2006
1 parent 5209eda commit cadbcf2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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";
Expand Down

0 comments on commit cadbcf2

Please sign in to comment.