@matheusbsbs / matheus-bagliano / commits / 42277bc81c
Fork 0

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 <branch> for update. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Mar 30, 2006 at 14:06 UTC 42277bc81ce2f4450fe08239e4db34516f879c1d
1 file changed +1 -5
git-cvsimport.perl
+1 -5
@@ -677,11 +677,7 @@ my $commit = sub {
677 waitpid($pid,0);
678 die "Error running git-commit-tree: $?\n" if $?;
679
680 - open(C,">$git_dir/refs/heads/$branch")
681 - or die "Cannot open branch $branch for update: $!\n";
682 - print C "$cid\n"
683 - or die "Cannot write branch $branch for update: $!\n";
684 - close(C)
680 + system("git-update-ref refs/heads/$branch $cid") == 0
681 or die "Cannot write branch $branch for update: $!\n";
682
683 if($tag) {