X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-cvsimport.perl;h=f68afe78a0a0ea4997b8988f241cd3a675d785f9;hb=20f1eb6b46645115695329a371d412eb3e714865;hp=ac74bc51b3197d06f13f588d6916400ac3e6fcf0;hpb=5f5dbd719d0d8ec136f32a0a56674902bd85f72f;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index ac74bc51b..f68afe78a 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -559,11 +559,6 @@ unless (-d $git_dir) { $last_branch = $opt_o; $orig_branch = ""; } else { - -f "$git_dir/refs/heads/$opt_o" - or die "Branch '$opt_o' does not exist.\n". - "Either use the correct '-o branch' option,\n". - "or import to a new repository.\n"; - open(F, "git-symbolic-ref HEAD |") or die "Cannot run git-symbolic-ref: $!\n"; chomp ($last_branch = ); @@ -588,6 +583,11 @@ unless (-d $git_dir) { $branch_date{$head} = $1; } close(H); + if (!exists $branch_date{$opt_o}) { + die "Branch '$opt_o' does not exist.\n". + "Either use the correct '-o branch' option,\n". + "or import to a new repository.\n"; + } } -d $git_dir