summaryrefslogtreecommitdiff
path: root/git-difftool.perl
diff options
context:
space:
mode:
authorTim Henigan <tim.henigan@gmail.com>2012-03-22 15:52:21 -0400
committerJunio C Hamano <gitster@pobox.com>2012-03-23 11:46:26 -0700
commite9653615fafcbac6109da99fac4fa66b0b432048 (patch)
treee9bdb2c6d90c240c20387cccf67e0a3c065c25fb /git-difftool.perl
parent11bf87076a686dbfe696dd21333486cab55e6fbb (diff)
downloadgit-e9653615fafcbac6109da99fac4fa66b0b432048.tar.gz
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>
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-xgit-difftool.perl9
1 files changed, 2 insertions, 7 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index a3ad389569..aba3d2f8cb 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