summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-23 20:51:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-23 20:51:11 (GMT)
commit73e7b2ef6c62b3ec345b557acb71a8da4798c70d (patch)
tree854951da72e8777ba36576a7278a10b9cc49b133
parent4e3a1b24ad4ee3fc7dc21a8b8f39c41202d6b0a5 (diff)
parentd531174fe386af00755619d6a204db74a30954f8 (diff)
downloadgit-73e7b2ef6c62b3ec345b557acb71a8da4798c70d.zip
git-73e7b2ef6c62b3ec345b557acb71a8da4798c70d.tar.gz
git-73e7b2ef6c62b3ec345b557acb71a8da4798c70d.tar.bz2
Merge branch 'rj/maint-difftool-cygwin-workaround'
* rj/maint-difftool-cygwin-workaround: difftool: Fix failure on Cygwin
-rwxr-xr-xgit-difftool.perl12
1 files changed, 8 insertions, 4 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index e95e4ad..ced1615 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -52,6 +52,7 @@ sub generate_command
my @command = (exe('git'), 'diff');
my $skip_next = 0;
my $idx = -1;
+ my $prompt = '';
for my $arg (@ARGV) {
$idx++;
if ($skip_next) {
@@ -89,13 +90,11 @@ sub generate_command
next;
}
if ($arg eq '-y' || $arg eq '--no-prompt') {
- $ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
- delete $ENV{GIT_DIFFTOOL_PROMPT};
+ $prompt = 'no';
next;
}
if ($arg eq '--prompt') {
- $ENV{GIT_DIFFTOOL_PROMPT} = 'true';
- delete $ENV{GIT_DIFFTOOL_NO_PROMPT};
+ $prompt = 'yes';
next;
}
if ($arg eq '-h' || $arg eq '--help') {
@@ -103,6 +102,11 @@ sub generate_command
}
push @command, $arg;
}
+ if ($prompt eq 'yes') {
+ $ENV{GIT_DIFFTOOL_PROMPT} = 'true';
+ } elsif ($prompt eq 'no') {
+ $ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
+ }
return @command
}