Emit a whole line in one go
[gitweb.git] / git-add--interactive.perl
index 7493e68b8430c2dc3e3c707a5db59179e69a11d8..21f1330a5bf26c955051ce9cf263289d90c7667b 100755 (executable)
@@ -1012,8 +1012,7 @@ sub edit_hunk_manually {
 EOF
        close $fh;
 
-       my $editor = $ENV{GIT_EDITOR} || $repo->config("core.editor")
-               || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
+       chomp(my $editor = run_cmd_pipe(qw(git var GIT_EDITOR)));
        system('sh', '-c', $editor.' "$@"', $editor, $hunkfile);
 
        if ($? != 0) {