Skip to content

Commit

Permalink
Merge branch 'rj/maint-difftool-cygwin-workaround'
Browse files Browse the repository at this point in the history
* rj/maint-difftool-cygwin-workaround:
  difftool: Fix failure on Cygwin
  • Loading branch information
gitster committed Dec 23, 2010
2 parents 4e3a1b2 + d531174 commit 73e7b2e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions git-difftool.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -89,20 +90,23 @@ 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') {
usage();
}
push @command, $arg;
}
if ($prompt eq 'yes') {
$ENV{GIT_DIFFTOOL_PROMPT} = 'true';
} elsif ($prompt eq 'no') {
$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
}
return @command
}

Expand Down

0 comments on commit 73e7b2e

Please sign in to comment.