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>
This commit is contained in:
Johannes Schindelin 2006-03-30 14:06:15 +02:00 коммит произвёл Junio C Hamano
Родитель fc4c4cd21c
Коммит 42277bc81c
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -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) {