Skip to content

Commit

Permalink
difftool: eliminate setup_environment function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tim Henigan authored and Junio C Hamano committed Mar 23, 2012
1 parent 11bf870 commit e965361
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions git-difftool.perl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ sub 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);
Expand Down Expand Up @@ -79,7 +73,8 @@ sub setup_environment
}
}

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
Expand Down

0 comments on commit e965361

Please sign in to comment.