summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-04-03 12:28:42 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-04-03 12:28:42 -0700
commitaa8b12505b4b8365ba96236a0e7698959063765e (patch)
treea8451a5ce85b826854efe162839c6dd639909d62
parentMerge branch 'rb/maint-python-path' (diff)
parentsend-email: lazily assign editor variable (diff)
downloadtgif-aa8b12505b4b8365ba96236a0e7698959063765e.tar.xz
Merge branch 'mg/maint-send-email-lazy-editor'
* mg/maint-send-email-lazy-editor: send-email: lazily assign editor variable
-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 33bcfb4e76..ce569a9c8f 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, $_);