From: Eric Wong Date: Thu, 22 Jun 2006 08:22:46 +0000 (-0700) Subject: git-svn: fix commit --edit flag when using SVN:: libraries X-Git-Tag: v1.4.1-rc1^2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec9d00d078ed1625d8c85a25618dfa2aa8042b69;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl index 7e7f2f0cd..08c30103f 100755 --- a/contrib/git-svn/git-svn.perl +++ b/contrib/git-svn/git-svn.perl @@ -479,17 +479,18 @@ sub commit_lib { my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : (); my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$"; + if (defined $LC_ALL) { + $ENV{LC_ALL} = $LC_ALL; + } else { + delete $ENV{LC_ALL}; + } foreach my $c (@revs) { + my $log_msg = get_commit_message($c, $commit_msg); + # fork for each commit because there's a memory leak I # can't track down... (it's probably in the SVN code) defined(my $pid = open my $fh, '-|') or croak $!; if (!$pid) { - if (defined $LC_ALL) { - $ENV{LC_ALL} = $LC_ALL; - } else { - delete $ENV{LC_ALL}; - } - my $log_msg = get_commit_message($c, $commit_msg); my $ed = SVN::Git::Editor->new( { r => $r_last, ra => $SVN, @@ -535,6 +536,7 @@ sub commit_lib { ($r_last, $cmt_last) = ($r_new, $cmt_new); } } + $ENV{LC_ALL} = 'C'; unlink $commit_msg; }