* [PATCH] difftool: use perl built-ins when testing for msys
@ 2009-03-25 6:13 David Aguilar
0 siblings, 0 replies; only message in thread
From: David Aguilar @ 2009-03-25 6:13 UTC (permalink / raw)
To: gitster; +Cc: git, David Aguilar
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>
---
git-difftool.perl | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-difftool.perl b/git-difftool.perl
index 0deda3a..207dd50 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -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;
--
1.6.2.1.303.g63699
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-25 6:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 6:13 [PATCH] difftool: use perl built-ins when testing for msys David Aguilar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).