Skip to contentSkip to conversation

difftool: eliminate setup_environment function

PATCH Superseded Tim Henigan 1 participant 1 message Jun 15, 2016

v1 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

PATCH 5/9 difftool: eliminate setup_environment function

Removing this function shortens the code and makes it easier to read. Now all environment variables are set as part of procedural operation.

---
 git-difftool.perl |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
git-difftool.perl +2 -7
index 99ff587..9495f14 100755
@@ -27,12 +27,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, $no_prompt, $prompt);
@@ -76,7 +70,8 @@ elsif (defined($no_prompt)) {
 	$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
 }
 
-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
Signature · 1 line
1.7.9.1.290.gbd444