summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-10-31 01:42:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-13 20:20:50 (GMT)
commitb4479f074760a788dd4e353b8c86a7d735afc53e (patch)
tree5680844fb47dd256945296a8466de81a4bfb17ec /git-add--interactive.perl
parent6361824589bc2d32989a9a33f985d09a368436a3 (diff)
downloadgit-b4479f074760a788dd4e353b8c86a7d735afc53e.zip
git-b4479f074760a788dd4e353b8c86a7d735afc53e.tar.gz
git-b4479f074760a788dd4e353b8c86a7d735afc53e.tar.bz2
add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
Use the new "git var GIT_EDITOR" feature to decide what editor to use, instead of duplicating its logic elsewhere. This should make the behavior of commands in edge cases (e.g., editor names with spaces) a little more consistent. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 69aeaf0..0c74e5c 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -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) {