X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-cvsimport.perl;h=efe193439bda26d72be3f94b9dd164013967b14f;hb=b17e659dd4007cb1d3eb5ac32b524c0c5ab59601;hp=0621dc3e2f6d8de2f0019164d57cc8916deb6b98;hpb=f865a2ad981f72423aa1c19412ce57c543801957;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 0621dc3e..efe19343 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -29,7 +29,7 @@ use IPC::Open2; $SIG{'PIPE'}="IGNORE"; $ENV{'TZ'}="UTC"; -our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s,$opt_m,$opt_M); +our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M); sub usage() { print STDERR <); + $last_branch = basename($last_branch); + close(F); unless($last_branch) { warn "Cannot read the last branch name: $! -- assuming 'master'\n"; $last_branch = "master"; @@ -487,11 +495,16 @@ unless($pid) { my @opt; @opt = split(/,/,$opt_p) if defined $opt_p; unshift @opt, '-z', $opt_z if defined $opt_z; - unless ($opt_p =~ m/--no-cvs-direct/) { + unshift @opt, '-q' unless defined $opt_v; + unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) { push @opt, '--cvs-direct'; } - exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree); - die "Could not start cvsps: $!\n"; + if ($opt_P) { + exec("cat", $opt_P); + } else { + exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree); + die "Could not start cvsps: $!\n"; + } } @@ -820,8 +833,7 @@ if($orig_branch) { print "DONE; creating $orig_branch branch\n" if $opt_v; system("cp","$git_dir/refs/heads/$opt_o","$git_dir/refs/heads/master") unless -f "$git_dir/refs/heads/master"; - unlink("$git_dir/HEAD"); - symlink("refs/heads/$orig_branch","$git_dir/HEAD"); + system('git-update-ref', 'HEAD', "$orig_branch"); unless ($opt_i) { system('git checkout'); die "checkout failed: $?\n" if $?;