Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If your auto start instance is not valid and you run
ckan compare 1.2.3 4.5.6
, you get an extra warning message in addition to the expected output:This isn't useful because we're not trying to do anything with auto start instances, we're just comparing version strings.
The same message is printed by many of the tests.
Cause
When we instantiate a
KSPManager
, its constructor callsLoadInstancesFromRegistry
, which setsAutoStartInstance
:CKAN/Core/KSPManager.cs
Lines 422 to 430 in 00211bd
However, the value passed is what
AutoStartInstance
would already return!CKAN/Core/KSPManager.cs
Lines 25 to 36 in ad32e9e
So that assignment doesn't accomplish anything. It does throw an exception if the current auto start instance isn't valid, however, which is just caught and printed as a warning.
Changes
LoadInstancesFromRegistry
no longer pointlessly assigns toAutoStartInstance
AutoStartInstance
now returns null if the value in the registry isn't the name of an instanceWin32Registry.SetRegistryToInstances
no longer accepts the auto start instance as a parameter since all calls to it were just passing the value already in the registryFixes #2774.