summaryrefslogtreecommitdiff
path: root/git-cvsimport.perl
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-03-30 12:06:15 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-05 00:13:25 (GMT)
commit42277bc81ce2f4450fe08239e4db34516f879c1d (patch)
tree414cb7d3382ec672a3a0534fdcd7e6d80465f662 /git-cvsimport.perl
parentfc4c4cd21c783b6dc387002c6e018d26f7405e9f (diff)
downloadgit-42277bc81ce2f4450fe08239e4db34516f879c1d.zip
git-42277bc81ce2f4450fe08239e4db34516f879c1d.tar.gz
git-42277bc81ce2f4450fe08239e4db34516f879c1d.tar.bz2
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>
Diffstat (limited to 'git-cvsimport.perl')
-rwxr-xr-xgit-cvsimport.perl6
1 files changed, 1 insertions, 5 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 3728294..c0ae00b 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) {