Skip to content

Commit 23fcdc7

Browse files
Michael Milligangitster
authored andcommitted
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 <[email protected]>
1 parent e59ade9 commit 23fcdc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-cvsimport.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ sub commit {
692692
if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
693693
# looks like an initial commit
694694
# 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";
697697
} else {
698698
# use an index per branch to speed up
699699
# imports of projects with many branches
@@ -984,7 +984,7 @@ sub commit {
984984
}
985985
986986
foreach my $git_index (values %index) {
987-
if ($git_index ne '.git/index') {
987+
if ($git_index ne "$git_dir/index") {
988988
unlink($git_index);
989989
}
990990
}

0 commit comments

Comments
 (0)