]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-svn.perl
Fix GIT_CEILING_DIRECTORIES on Windows
[thirdparty/git.git] / git-svn.perl
index 33e1b503c4d58f5f0a0c109a37968419710fbd11..25ed2f43335bfa717d9bbc1a799c7841c25b1cc0 100755 (executable)
@@ -1126,7 +1126,7 @@ sub read_repo_config {
                my $v = $opts->{$o};
                my ($key) = ($o =~ /^([a-zA-Z\-]+)/);
                $key =~ s/-//g;
-               my $arg = 'git-config';
+               my $arg = 'git config';
                $arg .= ' --int' if ($o =~ /[:=]i$/);
                $arg .= ' --bool' if ($o !~ /[:=][sfi]$/);
                if (ref $v eq 'ARRAY') {
@@ -2202,7 +2202,7 @@ sub do_git_commit {
        }
        die "Tree is not a valid sha1: $tree\n" if $tree !~ /^$::sha1$/o;
 
-       my @exec = ('git-commit-tree', $tree);
+       my @exec = ('git', 'commit-tree', $tree);
        foreach ($self->get_commit_parents($log_entry)) {
                push @exec, '-p', $_;
        }
@@ -2318,12 +2318,20 @@ sub find_parent_branch {
                $gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);
        }
        my ($r0, $parent) = $gs->find_rev_before($r, 1);
-       if (!defined $r0 || !defined $parent) {
-               my ($base, $head) = parse_revision_argument(0, $r);
-               if ($base <= $r) {
+       {
+               my ($base, $head);
+               if (!defined $r0 || !defined $parent) {
+                       ($base, $head) = parse_revision_argument(0, $r);
+               } else {
+                       if ($r0 < $r) {
+                               $gs->ra->get_log([$gs->{path}], $r0 + 1, $r, 1,
+                                       0, 1, sub { $base = $_[1] - 1 });
+                       }
+               }
+               if (defined $base && $base <= $r) {
                        $gs->fetch($base, $r);
                }
-               ($r0, $parent) = $gs->last_rev_commit;
+               ($r0, $parent) = $gs->find_rev_before($r, 1);
        }
        if (defined $r0 && defined $parent) {
                print STDERR "Found branch parent: ($self->{ref_id}) $parent\n";