add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
[gitweb.git] / git-svn.perl
index 6a3b501d24ebaa50e297511ccf0b18e3bbd2bb16..42c9a728adc9e217bd06479562b72235454d7b54 100755 (executable)
@@ -1321,9 +1321,8 @@ sub get_commit_entry {
        close $log_fh or croak $!;
 
        if ($_edit || ($type eq 'tree')) {
-               my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';
-               # TODO: strip out spaces, comments, like git-commit.sh
-               system($editor, $commit_editmsg);
+               chomp(my $editor = command_oneline(qw(var GIT_EDITOR)));
+               system('sh', '-c', $editor.' "$@"', $editor, $commit_editmsg);
        }
        rename $commit_editmsg, $commit_msg or croak $!;
        {