diff options
author | Junio C Hamano <junkio@cox.net> | 2005-11-16 21:32:44 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-16 21:32:44 -0800 |
commit | 27dedf0c3b78d1072fb5449149421284f9e5297b (patch) | |
tree | 80da2302f50bb1f396611a4a54a6da52a4592bd0 /git-cvsimport.perl | |
parent | 60d64db4614b1007ca37c228923ec1964d5ad394 (diff) | |
download | git-27dedf0c3b78d1072fb5449149421284f9e5297b.tar.gz |
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-cvsimport.perl')
-rwxr-xr-x | git-cvsimport.perl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 7bd9136205..efe193439b 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 = <F>); + $last_branch = basename($last_branch); + close(F); unless($last_branch) { warn "Cannot read the last branch name: $! -- assuming 'master'\n"; $last_branch = "master"; @@ -829,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 $?; |