From 42277bc81ce2f4450fe08239e4db34516f879c1d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 30 Mar 2006 14:06:15 +0200 Subject: [PATCH] cvsimport: use git-update-ref when updating This simplifies code, and also fixes a subtle bug: when importing in a shared repository, where another user last imported from CVS, cvsimport used to complain that it could not open for update. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-cvsimport.perl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 3728294e7..c0ae00bda 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -677,11 +677,7 @@ my $commit = sub { waitpid($pid,0); die "Error running git-commit-tree: $?\n" if $?; - open(C,">$git_dir/refs/heads/$branch") - or die "Cannot open branch $branch for update: $!\n"; - print C "$cid\n" - or die "Cannot write branch $branch for update: $!\n"; - close(C) + system("git-update-ref refs/heads/$branch $cid") == 0 or die "Cannot write branch $branch for update: $!\n"; if($tag) { -- 2.30.2