summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-04-03 19:28:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-04-03 19:28:42 (GMT)
commitaa8b12505b4b8365ba96236a0e7698959063765e (patch)
treea8451a5ce85b826854efe162839c6dd639909d62 /git-send-email.perl
parent4de113cdf55631ef1f8bf34658fb647509520e8a (diff)
parent0ce142c944181236f99ea3f7fc72712f3e43d2e2 (diff)
downloadgit-aa8b12505b4b8365ba96236a0e7698959063765e.zip
git-aa8b12505b4b8365ba96236a0e7698959063765e.tar.gz
git-aa8b12505b4b8365ba96236a0e7698959063765e.tar.bz2
Merge branch 'mg/maint-send-email-lazy-editor'
* mg/maint-send-email-lazy-editor: send-email: lazily assign editor variable
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 33bcfb4..ce569a9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -166,9 +166,12 @@ my $compose_filename;
# Handle interactive edition of files.
my $multiedit;
-my $editor = Git::command_oneline('var', 'GIT_EDITOR');
+my $editor;
sub do_edit {
+ if (!defined($editor)) {
+ $editor = Git::command_oneline('var', 'GIT_EDITOR');
+ }
if (defined($multiedit) && !$multiedit) {
map {
system('sh', '-c', $editor.' "$@"', $editor, $_);