Skip to content

Commit 061303f

Browse files
dschoJunio C Hamano
authored andcommitted
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>
1 parent 7ccd900 commit 061303f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

git-cvsimport.perl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ ($$)
470470
$index{$opt_o} = tmpnam();
471471

472472
$ENV{GIT_INDEX_FILE} = $index{$opt_o};
473+
system("git-read-tree", $opt_o);
474+
die "read-tree failed: $?\n" if $?;
475+
473476
unless(-d $git_dir) {
474477
system("git-init-db");
475478
die "Cannot init the GIT db at $git_tree: $?\n" if $?;
@@ -813,17 +816,15 @@ sub commit {
813816
unless ($index{$branch}) {
814817
$index{$branch} = tmpnam();
815818
$ENV{GIT_INDEX_FILE} = $index{$branch};
819+
system("git-read-tree", $branch);
820+
die "read-tree failed: $?\n" if $?;
816821
}
822+
# just in case
823+
$ENV{GIT_INDEX_FILE} = $index{$branch};
817824
if ($ancestor) {
825+
print "have ancestor $ancestor" if $opt_v;
818826
system("git-read-tree", $ancestor);
819827
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-
}
827828
}
828829
} else {
829830
# just in case

0 commit comments

Comments
 (0)