From: Matthias Urlichs Date: Thu, 30 Jun 2005 20:10:32 +0000 (+0200) Subject: cvsimport: Exit if an existing repository doesn't have the right branch. X-Git-Tag: v0.99~71^2^2~10 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4c24e089a33d27e9f15dc746c43a816fabcc060c;p=git.git cvsimport: Exit if an existing repository doesn't have the right branch. --- diff --git a/git-cvsimport-script b/git-cvsimport-script index 3f157725..1151fb8c 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";