File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ sub generate_command
5252 my @command = (exe(' git' ), ' diff' );
5353 my $skip_next = 0;
5454 my $idx = -1;
55+ my $prompt = ' ' ;
5556 for my $arg (@ARGV ) {
5657 $idx ++;
5758 if ($skip_next ) {
@@ -89,20 +90,23 @@ sub generate_command
8990 next ;
9091 }
9192 if ($arg eq ' -y' || $arg eq ' --no-prompt' ) {
92- $ENV {GIT_DIFFTOOL_NO_PROMPT } = ' true' ;
93- delete $ENV {GIT_DIFFTOOL_PROMPT };
93+ $prompt = ' no' ;
9494 next ;
9595 }
9696 if ($arg eq ' --prompt' ) {
97- $ENV {GIT_DIFFTOOL_PROMPT } = ' true' ;
98- delete $ENV {GIT_DIFFTOOL_NO_PROMPT };
97+ $prompt = ' yes' ;
9998 next ;
10099 }
101100 if ($arg eq ' -h' || $arg eq ' --help' ) {
102101 usage();
103102 }
104103 push @command , $arg ;
105104 }
105+ if ($prompt eq ' yes' ) {
106+ $ENV {GIT_DIFFTOOL_PROMPT } = ' true' ;
107+ } elsif ($prompt eq ' no' ) {
108+ $ENV {GIT_DIFFTOOL_NO_PROMPT } = ' true' ;
109+ }
106110 return @command
107111}
108112
You can’t perform that action at this time.
0 commit comments