Skip to content

Commit

Permalink
git-cvsimport: Make sure to use $git_dir always instead of .git somet…
Browse files Browse the repository at this point in the history
…imes

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>
  • Loading branch information
Michael Milligan authored and Junio C Hamano committed Jun 6, 2007
1 parent e59ade9 commit 23fcdc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ sub commit {
if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
# looks like an initial commit
# use the index primed by git-init
$ENV{GIT_INDEX_FILE} = '.git/index';
$index{$branch} = '.git/index';
$ENV{GIT_INDEX_FILE} = "$git_dir/index";
$index{$branch} = "$git_dir/index";
} else {
# use an index per branch to speed up
# imports of projects with many branches
Expand Down Expand Up @@ -984,7 +984,7 @@ sub commit {
}
foreach my $git_index (values %index) {
if ($git_index ne '.git/index') {
if ($git_index ne "$git_dir/index") {
unlink($git_index);
}
}
Expand Down

0 comments on commit 23fcdc7

Please sign in to comment.