summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-20 23:48:52 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-20 23:48:52 -0800
commit376f39fbea0dfb31402abda878a7b0018f6a6161 (patch)
treed97dd8a947407fc4c36a97ad7b8b37e6b8142e9e /git-add--interactive.perl
parent7a4383cf13819cd2ef00f0d60318aad3f1813117 (diff)
parenta3d023d0a3783612053f2149e784b43befceccad (diff)
downloadgit-376f39fbea0dfb31402abda878a7b0018f6a6161.tar.gz
Merge branch 'jn/editor-pager'
* jn/editor-pager: Provide a build time default-pager setting Provide a build time default-editor setting am -i, git-svn: use "git var GIT_PAGER" add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR" Teach git var about GIT_PAGER Teach git var about GIT_EDITOR Suppress warnings from "git var -l" Do not use VISUAL editor on dumb terminals Handle more shell metacharacters in editor names
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) {