mirror of
https://github.com/git/git.git
synced 2024-11-02 07:17:58 +01:00
Merge branch 'rj/maint-difftool-cygwin-workaround'
* rj/maint-difftool-cygwin-workaround: difftool: Fix failure on Cygwin
This commit is contained in:
commit
73e7b2ef6c
1 changed files with 8 additions and 4 deletions
|
@ -52,6 +52,7 @@ sub generate_command
|
||||||
my @command = (exe('git'), 'diff');
|
my @command = (exe('git'), 'diff');
|
||||||
my $skip_next = 0;
|
my $skip_next = 0;
|
||||||
my $idx = -1;
|
my $idx = -1;
|
||||||
|
my $prompt = '';
|
||||||
for my $arg (@ARGV) {
|
for my $arg (@ARGV) {
|
||||||
$idx++;
|
$idx++;
|
||||||
if ($skip_next) {
|
if ($skip_next) {
|
||||||
|
@ -89,13 +90,11 @@ sub generate_command
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ($arg eq '-y' || $arg eq '--no-prompt') {
|
if ($arg eq '-y' || $arg eq '--no-prompt') {
|
||||||
$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
|
$prompt = 'no';
|
||||||
delete $ENV{GIT_DIFFTOOL_PROMPT};
|
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ($arg eq '--prompt') {
|
if ($arg eq '--prompt') {
|
||||||
$ENV{GIT_DIFFTOOL_PROMPT} = 'true';
|
$prompt = 'yes';
|
||||||
delete $ENV{GIT_DIFFTOOL_NO_PROMPT};
|
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ($arg eq '-h' || $arg eq '--help') {
|
if ($arg eq '-h' || $arg eq '--help') {
|
||||||
|
@ -103,6 +102,11 @@ sub generate_command
|
||||||
}
|
}
|
||||||
push @command, $arg;
|
push @command, $arg;
|
||||||
}
|
}
|
||||||
|
if ($prompt eq 'yes') {
|
||||||
|
$ENV{GIT_DIFFTOOL_PROMPT} = 'true';
|
||||||
|
} elsif ($prompt eq 'no') {
|
||||||
|
$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
|
||||||
|
}
|
||||||
return @command
|
return @command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue