git-cvsimport-script: update cvsps cache instead of rebuilding it
[git.git] / git-cvsimport-script
index 0531af3..62df916 100755 (executable)
@@ -436,7 +436,7 @@ die "Cannot fork: $!\n" unless defined $pid;
 unless($pid) {
        my @opt;
        @opt = split(/,/,$opt_p) if defined $opt_p;
-       exec("cvsps",@opt,"-x","-A","--cvs-direct",'--root',$opt_d,$cvs_tree);
+       exec("cvsps",@opt,"-u","-A","--cvs-direct",'--root',$opt_d,$cvs_tree);
        die "Could not start cvsps: $!\n";
 }
 
@@ -651,9 +651,10 @@ while(<CVS>) {
                }
                if(($ancestor || $branch) ne $last_branch) {
                        print "Switching from $last_branch to $branch\n" if $opt_v;
-                       system("git-read-tree","-m","$last_branch","$branch");
+                       system("git-read-tree", $branch);
                        die "read-tree failed: $?\n" if $?;
                }
+               $last_branch = $branch if $branch ne $last_branch;
                $state = 9;
        } elsif($state == 8) {
                $logmsg .= "$_\n";