X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-cvsimport.perl;h=8619e7d18382ae41f87b5959b9233718ed99def6;hb=d5a6aafc90a14382120727e4e81ee1a380e8b194;hp=7bd9136205f46d4334b7272e6617c0f7f553f5e8;hpb=235d521da60e4699e5bd59ac658b5b48bd76ddca;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 7bd91362..8619e7d1 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"; @@ -498,7 +502,7 @@ unless($pid) { 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"; } } @@ -645,6 +649,7 @@ my $commit = sub { my($xtag) = $tag; $xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY ** $xtag =~ tr/_/\./ if ( $opt_u ); + $xtag =~ s/[\/]/$opt_s/g; my $pid = open2($in, $out, 'git-mktag'); print $out "object $cid\n". @@ -829,8 +834,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 $?;