Merge in 1.6.5.4
[gitweb.git] / git-add--interactive.perl
index 8ce1ec92c2b04e1271b3ee1a41a2ac60d2f8aad4..f813ffdaa1526aa68b4ed8e7d4d04b48e270496a 100755 (executable)
@@ -990,8 +990,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) {