Skip to content

Commit

Permalink
cvsimport: always set $ENV{GIT_INDEX_FILE} to $index{$branch}
Browse files Browse the repository at this point in the history
Also, make sure that the initial git-read-tree is performed.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jun 25, 2006
1 parent 7ccd900 commit 061303f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ ($$)
$index{$opt_o} = tmpnam();

$ENV{GIT_INDEX_FILE} = $index{$opt_o};
system("git-read-tree", $opt_o);
die "read-tree failed: $?\n" if $?;

unless(-d $git_dir) {
system("git-init-db");
die "Cannot init the GIT db at $git_tree: $?\n" if $?;
Expand Down Expand Up @@ -813,17 +816,15 @@ sub commit {
unless ($index{$branch}) {
$index{$branch} = tmpnam();
$ENV{GIT_INDEX_FILE} = $index{$branch};
system("git-read-tree", $branch);
die "read-tree failed: $?\n" if $?;
}
# just in case
$ENV{GIT_INDEX_FILE} = $index{$branch};
if ($ancestor) {
print "have ancestor $ancestor" if $opt_v;
system("git-read-tree", $ancestor);
die "read-tree failed: $?\n" if $?;
} else {
unless ($index{$branch}) {
$index{$branch} = tmpnam();
$ENV{GIT_INDEX_FILE} = $index{$branch};
system("git-read-tree", $branch);
die "read-tree failed: $?\n" if $?;
}
}
} else {
# just in case
Expand Down

0 comments on commit 061303f

Please sign in to comment.