Skip to content

Commit 42277bc

Browse files
dschoJunio C Hamano
authored andcommitted
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>
1 parent fc4c4cd commit 42277bc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

git-cvsimport.perl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,7 @@ ($$)
677677
waitpid($pid,0);
678678
die "Error running git-commit-tree: $?\n" if $?;
679679

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
685681
or die "Cannot write branch $branch for update: $!\n";
686682

687683
if($tag) {

0 commit comments

Comments
 (0)