Merge branch 'mg/maint-send-email-lazy-editor' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 10 Apr 2010 05:23:04 +0000 (22:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 10 Apr 2010 05:23:04 +0000 (22:23 -0700)
* mg/maint-send-email-lazy-editor:
send-email: lazily assign editor variable

git-send-email.perl
index e05455f74c7e23c28cae41b68fa80df87c633ce9..1b99f40390ab62102cfb0aeaba5303c9c6904930 100755 (executable)
@@ -162,9 +162,12 @@ sub format_2822_time {
 
 # 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, $_);