diff options
author | Junio C Hamano <junkio@cox.net> | 2007-05-23 11:39:53 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-23 11:39:53 -0700 |
commit | 1654a3ba0c3a91ee3c0f38c922e3d2d1255ec868 (patch) | |
tree | a390b0569ab7d7cac68822a23463d4869f186cb4 | |
parent | Fix command line parameter parser of revert/cherry-pick (diff) | |
parent | Use git-for-each-ref to check whether the origin branch exists. (diff) | |
download | tgif-1654a3ba0c3a91ee3c0f38c922e3d2d1255ec868.tar.xz |
Merge branch 'maint'
* maint:
Use git-for-each-ref to check whether the origin branch exists.
-rwxr-xr-x | git-cvsimport.perl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index ac74bc51b3..f68afe78a0 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 = <F>); @@ -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 |