From: Tim Henigan Date: Thu, 22 Mar 2012 19:52:21 GMT Subject: [PATCH 6/9 v6] difftool: eliminate setup_environment function Message-ID: <1332445944-10944-7-git-send-email-tim.henigan@gmail.com> In-Reply-To: <1332445944-10944-1-git-send-email-tim.henigan@gmail.com> Removing this function shortens the code and makes it easier to read. Now all environment variables are set as part of procedural operation. Signed-off-by: Tim Henigan --- git-difftool.perl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/git-difftool.perl b/git-difftool.perl index 493260d..d4fe998 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -29,12 +29,6 @@ USAGE exit($exitcode); } -sub setup_environment -{ - $ENV{GIT_PAGER} = ''; - $ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper'; -} - # parse command-line options. all unrecognized options and arguments # are passed through to the 'git diff' command. my ($difftool_cmd, $extcmd, $gui, $help, $prompt); @@ -79,7 +73,8 @@ if (defined($prompt)) { } } -setup_environment(); +$ENV{GIT_PAGER} = ''; +$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper'; my @command = ('git', 'diff', @ARGV); # ActiveState Perl for Win32 does not implement POSIX semantics of -- 1.7.10.rc1.36.g15e879