Browse Source

git-cvsimport: Make sure to use $git_dir always instead of .git sometimes

CVS import was failing on a couple repos I was trying to import.
I was setting GIT_DIR=newproj.git and using the -i flag, but this bug
was thwarting the effort...  evil CVS.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Michael Milligan 18 years ago committed by Junio C Hamano
parent
commit
23fcdc7971
  1. 6
      git-cvsimport.perl

6
git-cvsimport.perl

@ -692,8 +692,8 @@ sub commit {
if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) { if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
# looks like an initial commit # looks like an initial commit
# use the index primed by git-init # use the index primed by git-init
$ENV{GIT_INDEX_FILE} = '.git/index'; $ENV{GIT_INDEX_FILE} = "$git_dir/index";
$index{$branch} = '.git/index'; $index{$branch} = "$git_dir/index";
} else { } else {
# use an index per branch to speed up # use an index per branch to speed up
# imports of projects with many branches # imports of projects with many branches
@ -984,7 +984,7 @@ if ($line =~ /^(\d+) objects, (\d+) kilobytes$/) {
} }


foreach my $git_index (values %index) { foreach my $git_index (values %index) {
if ($git_index ne '.git/index') { if ($git_index ne "$git_dir/index") {
unlink($git_index); unlink($git_index);
} }
} }

Loading…
Cancel
Save