add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
[gitweb.git] / git-add--interactive.perl
index 69aeaf03ec65922d8a3e5e092fab3d4b6ffcb63e..0c74e5c14ad15b3f90c2688b34637be5b70e3e0e 100755 (executable)
@@ -987,8 +987,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) {