read-tree --reset -u fix.
[gitweb.git] / git-cvsimport.perl
index 3728294e740b466b97f623302ddd89fab1ba0e92..c0ae00bda74e68f98efc63c093efb73c7ff914f4 100755 (executable)
@@ -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) {