summaryrefslogtreecommitdiff
path: root/git-cvsimport-script
diff options
context:
space:
mode:
authorMatthias Urlichs <smurf@kiste.(none)>2005-06-30 20:10:32 (GMT)
committerMatthias Urlichs <smurf@kiste.(none)>2005-06-30 20:10:32 (GMT)
commit4c24e089a33d27e9f15dc746c43a816fabcc060c (patch)
tree4e6b88985aca56c609a3a47108f3c24fc0c028a8 /git-cvsimport-script
parente371046b6473907aa6d62b7862a3afe9d33561e1 (diff)
downloadgit-4c24e089a33d27e9f15dc746c43a816fabcc060c.zip
git-4c24e089a33d27e9f15dc746c43a816fabcc060c.tar.gz
git-4c24e089a33d27e9f15dc746c43a816fabcc060c.tar.bz2
cvsimport: Exit if an existing repository doesn't have the right branch.
Diffstat (limited to 'git-cvsimport-script')
-rwxr-xr-xgit-cvsimport-script5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-cvsimport-script b/git-cvsimport-script
index 3f15772..1151fb8 100755
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -338,6 +338,11 @@ unless(-d $git_dir) {
$last_branch = $opt_o;
$orig_branch = "";
} else {
+ -f "$git_dir/refs/head/$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";
+
$last_branch = basename(readlink("$git_dir/HEAD"));
unless($last_branch) {
warn "Cannot read the last branch name: $! -- assuming 'master'\n";