Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Use git-for-each-ref to check whether the origin branch exists.
  • Loading branch information
Junio C Hamano committed May 23, 2007
2 parents 32309f5 + 7ca055f commit 1654a3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,6 @@ ($$)
$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 = <F>);
Expand All @@ -588,6 +583,11 @@ ($$)
$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
Expand Down

0 comments on commit 1654a3b

Please sign in to comment.