- defined(my $pid = fork) or croak $!;
- if (!$pid) {
- foreach my $u (map { "$full_url/$_" } (grep m!/$!, @ls)) {
- $u =~ s#/+$##;
- if ($u !~ m!\Q$full_url\E/(.+)$!) {
- print STDERR "W: Unrecognized URL: $u\n";
- die "This should never happen\n";
- }
- # don't try to init already existing refs
- my $id = $pfx.$1;
- $GIT_SVN = $ENV{GIT_SVN_ID} = $id;
- init_vars();
- unless (-d $GIT_SVN_DIR) {
- print "init $u => $id\n";
- cmd_init($u);
- }
+ foreach my $u (map { "$full_url/$_" } (grep m!/$!, @ls)) {
+ $u =~ s#/+$##;
+ if ($u !~ m!\Q$full_url\E/(.+)$!) {
+ print STDERR "W: Unrecognized URL: $u\n";
+ die "This should never happen\n";
+ }
+ # don't try to init already existing refs
+ my $id = $pfx.$1;
+ my $gs = eval { Git::SVN->new($id) };
+ unless ($gs) {
+ print "init $u => $id\n";
+ Git::SVN->init($id, $u);