Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-04-06 12:31:21 +0400
committerJunio C Hamano <gitster@pobox.com>2009-04-08 09:19:55 +0400
commit46ae156d6c8c48d521e4d858ed84d93259cfc61f (patch)
tree86a0baeb8f3a8b6369371cbe58fda7f30ef828d7 /contrib
parent2e8af7e42b15d4f2d573329ea2593a19f45f18d3 (diff)
difftool: use perl built-ins when testing for msys
I don't even know what $COMSPEC means so let's be safe and use the same perly $^O test add--interactive uses. While we're at it, make git-difftool match the prevalent git-perl style. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/difftool/git-difftool7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/difftool/git-difftool b/contrib/difftool/git-difftool
index 0deda3a0e4..207dd50f2c 100755
--- a/contrib/difftool/git-difftool
+++ b/contrib/difftool/git-difftool
@@ -33,7 +33,10 @@ sub setup_environment
sub exe
{
my $exe = shift;
- return defined $ENV{COMSPEC} ? "$exe.exe" : $exe;
+ if ($^O eq 'MSWin32' || $^O eq 'msys') {
+ return "$exe.exe";
+ }
+ return $exe;
}
sub generate_command
@@ -47,7 +50,7 @@ sub generate_command
$skip_next = 0;
next;
}
- if ($arg eq '-t' or $arg eq '--tool') {
+ if ($arg eq '-t' || $arg eq '--tool') {
usage() if $#ARGV <= $idx;
$ENV{GIT_DIFF_TOOL} = $ARGV[$idx + 1];
$skip_next = 1;