diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-01-19 08:26:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-01-19 08:26:24 -0800 |
commit | ea9590789fecdf1eb48bba6d8b8cadab3441fbda (patch) | |
tree | ee336b7cbaa3d749f7e069c8deabc3a09ad82d9e | |
parent | Merge branch 'rj/maint-test-fixes' into maint (diff) | |
parent | difftool: Fix failure on Cygwin (diff) | |
download | tgif-ea9590789fecdf1eb48bba6d8b8cadab3441fbda.tar.xz |
Merge branch 'rj/maint-difftool-cygwin-workaround' into maint
* rj/maint-difftool-cygwin-workaround:
difftool: Fix failure on Cygwin
-rwxr-xr-x | git-difftool.perl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git-difftool.perl b/git-difftool.perl index e95e4ad973..ced1615e21 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 } |