Merge branch 'ew/svn-branch-segfault-fix' into next
authorJunio C Hamano <gitster@pobox.com>
Wed, 7 Feb 2018 22:56:01 +0000 (14:56 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Feb 2018 22:56:01 +0000 (14:56 -0800)
Workaround for segfault with more recent versions of SVN.

* ew/svn-branch-segfault-fix:
git-svn: control destruction order to avoid segfault

1  2 
git-svn.perl
diff --combined git-svn.perl
index 76a75d0b3dfe36f0c82c3951f8b7b04849f808e1,b0129802465265e82037ad58e921465f4b951ab1..a6b6c3e40c180e58186f9ef8af5c6fd6fc654080
@@@ -931,7 -931,6 +931,7 @@@ sub cmd_dcommit 
                # information from different SVN repos, and paths
                # which are not underneath this repository root.
                my $rooturl = $gs->repos_root;
 +              Git::SVN::remove_username($rooturl);
                foreach my $d (@$linear_refs) {
                        my %parentshash;
                        read_commit_parents(\%parentshash, $d);
@@@ -1200,6 -1199,11 +1200,11 @@@ sub cmd_branch 
        $ctx->copy($src, $rev, $dst)
                unless $_dry_run;
  
+       # Release resources held by ctx before creating another SVN::Ra
+       # so destruction is orderly.  This seems necessary with SVN 1.9.5
+       # to avoid segfaults.
+       $ctx = undef;
        $gs->fetch_all;
  }