File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,9 +217,15 @@ Task IConfigurableComponent.ConfigureAsync(ConfigurationTarget target)
217217 // Clear any existing app entries in the configuration
218218 config . UnsetAll ( configLevel , helperKey , Regex . Escape ( appPath ) ) ;
219219
220+ // Reload updated helper settings (unset only clears entries in primary file, ignores includes and alternatives)
221+ currentValues = config . GetAll ( configLevel , GitConfigurationType . Raw , helperKey ) . ToArray ( ) ;
222+
220223 // Add an empty value for `credential.helper`, which has the effect of clearing any helper value
221224 // from any lower-level Git configuration, then add a second value which is the actual executable path.
222- config . Add ( configLevel , helperKey , string . Empty ) ;
225+ if ( ( currentValues . Length == 0 ) || ! string . IsNullOrWhiteSpace ( currentValues . Last ( ) ) )
226+ {
227+ config . Add ( configLevel , helperKey , string . Empty ) ;
228+ }
223229 config . Add ( configLevel , helperKey , appPath ) ;
224230 }
225231
You can’t perform that action at this time.
0 commit comments