@matheusbsbs / matheus-bagliano / commits / 061303f0b5
Fork 0

cvsimport: always set $ENV{GIT_INDEX_FILE} to $index{$branch}

Also, make sure that the initial git-read-tree is performed. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Johannes Schindelin committed Jun 24, 2006 at 21:42 UTC 061303f0b50a648db8e0af23791fc56181f6bf93
1 file changed +8 -7
git-cvsimport.perl
+8 -7
@@ -470,6 +470,9 @@ my %index; # holds filenames of one index per branch
470 $index{$opt_o} = tmpnam();
471
472 $ENV{GIT_INDEX_FILE} = $index{$opt_o};
473 +system("git-read-tree", $opt_o);
474 +die "read-tree failed: $?\n" if $?;
475 +
476 unless(-d $git_dir) {
477 system("git-init-db");
478 die "Cannot init the GIT db at $git_tree: $?\n" if $?;
@@ -813,17 +816,15 @@ while(<CVS>) {
816 unless ($index{$branch}) {
817 $index{$branch} = tmpnam();
818 $ENV{GIT_INDEX_FILE} = $index{$branch};
819 + system("git-read-tree", $branch);
820 + die "read-tree failed: $?\n" if $?;
821 }
822 + # just in case
823 + $ENV{GIT_INDEX_FILE} = $index{$branch};
824 if ($ancestor) {
825 + print "have ancestor $ancestor" if $opt_v;
826 system("git-read-tree", $ancestor);
827 die "read-tree failed: $?\n" if $?;
820 - } else {
821 - unless ($index{$branch}) {
822 - $index{$branch} = tmpnam();
823 - $ENV{GIT_INDEX_FILE} = $index{$branch};
824 - system("git-read-tree", $branch);
825 - die "read-tree failed: $?\n" if $?;
826 - }
828 }
829 } else {
830 # just in case