[PATCH] Use git-update-ref to update a ref during commit in git-cvsserver
- From
- Andy Parkins <andyparkins@gmail.com>
- Date
- Feb 20, 2007, 20:10 UTC
- Message-ID
- <200702202010.02128.andyparkins@gmail.com>
- In-Reply-To
- <200702200857.02779.andyparkins@gmail.com>
Nicholas Pitre mentioned that updating a reference should be done with git-update-ref.
This patch does that and includes the -m option to have the reflog updated as a bonus.
Signed-off-by: Andy Parkins <andyparkins@gmail.com> --- As promised...
git-cvsserver.perl | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl index b4ef6bc..54d943a 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -1216,9 +1216,9 @@ sub req_ci } close LOCKFILE; - my $reffile = "$ENV{GIT_DIR}refs/heads/$state->{module}"; - unlink($reffile); - rename($lockfile, $reffile); + my $reffile = "refs/heads/$state->{module}"; + `git-update-ref -m "git-cvsserver commit" $reffile $commithash $parenthash`; + unlink($lockfile); chdir "/"; print "ok\n";
-- 1.5.0.rc4.gb4d2