summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl3
1 files changed, 1 insertions, 2 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 8ce1ec92c2..f813ffdaa1 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -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) {