Documentation/git-cherry-pick: Add --replay and --no-commit.
[gitweb.git] / git-cvsimport.perl
index 7bd9136205f46d4334b7272e6617c0f7f553f5e8..08a890c2bb4292ddb4c7705da4ddc5a21bd1219a 100755 (executable)
@@ -437,7 +437,11 @@ ($$)
                       "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 = <F>);
+       $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 @@ ($$)
        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";
        }
 }
@@ -829,8 +833,7 @@ ($$)
        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 $?;