Skip to content

Commit

Permalink
git-svn: fix commit --edit flag when using SVN:: libraries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Jun 22, 2006
1 parent bbc932c commit ec9d00d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions contrib/git-svn/git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -535,6 +536,7 @@ sub commit_lib {
($r_last, $cmt_last) = ($r_new, $cmt_new);
}
}
$ENV{LC_ALL} = 'C';
unlink $commit_msg;
}

Expand Down

0 comments on commit ec9d00d

Please sign in to comment.