X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-cvsimport.perl;h=08a890c2bb4292ddb4c7705da4ddc5a21bd1219a;hb=556cb4e583ada79b7c2e632a548dca90a98c1b29;hp=0144670a578b154f611d3f0f9552af7078fecf2e;hpb=211dcac6430cdf77fcf2a968ffaf9313b5c059b0;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 0144670a..08a890c2 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -437,7 +437,11 @@ unless(-d $git_dir) { "Either use the correct '-o branch' option,\n". "or import to a new repository.\n"; - $last_branch = basename(readlink("$git_dir/HEAD")); + open(F, "git-symbolic-ref HEAD |") or + die "Cannot run git-symbolic-ref: $!\n"; + chomp ($last_branch = ); + $last_branch = basename($last_branch); + close(F); unless($last_branch) { warn "Cannot read the last branch name: $! -- assuming 'master'\n"; $last_branch = "master"; @@ -491,13 +495,14 @@ unless($pid) { my @opt; @opt = split(/,/,$opt_p) if defined $opt_p; unshift @opt, '-z', $opt_z if defined $opt_z; + unshift @opt, '-q' unless defined $opt_v; unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) { push @opt, '--cvs-direct'; } if ($opt_P) { exec("cat", $opt_P); } else { - exec("cvsps",@opt,"-u","-A",'--root',$opt_d,$cvs_tree); + exec("cvsps","--norc",@opt,"-u","-A",'--root',$opt_d,$cvs_tree); die "Could not start cvsps: $!\n"; } } @@ -828,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 $?;