@matheusbsbs / matheus-bagliano / commits / 23fcdc7971
Fork 0

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>

Michael Milligan committed Jun 5, 2007 at 00:06 UTC 23fcdc79713c47a6a0d50762b9311c9933a60d3f
1 file changed +3 -3
git-cvsimport.perl
+3 -3
@@ -692,8 +692,8 @@ sub commit {
692 if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
693 # looks like an initial commit
694 # use the index primed by git-init
695 - $ENV{GIT_INDEX_FILE} = '.git/index';
696 - $index{$branch} = '.git/index';
695 + $ENV{GIT_INDEX_FILE} = "$git_dir/index";
696 + $index{$branch} = "$git_dir/index";
697 } else {
698 # use an index per branch to speed up
699 # imports of projects with many branches
@@ -984,7 +984,7 @@ if ($line =~ /^(\d+) objects, (\d+) kilobytes$/) {
984 }
985
986 foreach my $git_index (values %index) {
987 - if ($git_index ne '.git/index') {
987 + if ($git_index ne "$git_dir/index") {
988 unlink($git_index);
989 }
990 }