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. Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tim Henigan committed
Mar 22, 2012 at 15:52 UTC
e9653615fafcbac6109da99fac4fa66b0b432048
1 file changed
+2
-7
git-difftool.perl
+2
-7
@@ -29,12 +29,6 @@ USAGE
29
exit($exitcode);
30
}
31
32
-sub setup_environment
33
-{
34
- $ENV{GIT_PAGER} = '';
35
- $ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';
36
-}
37
-
32
# parse command-line options. all unrecognized options and arguments
33
# are passed through to the 'git diff' command.
34
my ($difftool_cmd, $extcmd, $gui, $help, $prompt);
@@ -79,7 +73,8 @@ if (defined($prompt)) {
73
}
74
}
75
82
-setup_environment();
76
+$ENV{GIT_PAGER} = '';
77
+$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';
78
my @command = ('git', 'diff', @ARGV);
79
80
# ActiveState Perl for Win32 does not implement POSIX semantics of