@matheusbsbs / matheus-bagliano / commits / ec9d00d078
Fork 0

git-svn: fix commit --edit flag when using SVN:: libraries

Trying to open an interactive editor in the console while stdout is being piped to the parent process doesn't work out very well. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Jun 22, 2006 at 01:22 UTC ec9d00d078ed1625d8c85a25618dfa2aa8042b69
1 file changed +8 -6
contrib/git-svn/git-svn.perl
+8 -6
@@ -479,17 +479,18 @@ sub commit_lib {
479 my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
480 my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$";
481
482 + if (defined $LC_ALL) {
483 + $ENV{LC_ALL} = $LC_ALL;
484 + } else {
485 + delete $ENV{LC_ALL};
486 + }
487 foreach my $c (@revs) {
488 + my $log_msg = get_commit_message($c, $commit_msg);
489 +
490 # fork for each commit because there's a memory leak I
491 # can't track down... (it's probably in the SVN code)
492 defined(my $pid = open my $fh, '-|') or croak $!;
493 if (!$pid) {
487 - if (defined $LC_ALL) {
488 - $ENV{LC_ALL} = $LC_ALL;
489 - } else {
490 - delete $ENV{LC_ALL};
491 - }
492 - my $log_msg = get_commit_message($c, $commit_msg);
494 my $ed = SVN::Git::Editor->new(
495 { r => $r_last,
496 ra => $SVN,
@@ -535,6 +536,7 @@ sub commit_lib {
536 ($r_last, $cmt_last) = ($r_new, $cmt_new);
537 }
538 }
539 + $ENV{LC_ALL} = 'C';
540 unlink $commit_msg;
541 }
542