Skip to content

Commit

Permalink
cvsimport: use git-update-ref when updating
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Apr 5, 2006
1 parent fc4c4cd commit 42277bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,7 @@ ($$)
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) {
Expand Down

0 comments on commit 42277bc

Please sign in to comment.