winget source reset <name> removes default sources #1575
Description
opened on Oct 11, 2021
Brief description of your issue
winget source reset <name>
removes the named source when it is a default rather than resetting it. This is because DropSource
just removes the source from the list without invoking its Remove
as intended, but for a default source the removal from the list places a tombstone.
For a default source we should actually drop any existing item or tombstone in the list (save the platform special case). The result should be that resetting a default source by name gets you the exact same state as a clean install would for that source (source is configured but has empty metadata).
Steps to reproduce
winget source reset msstore
Expected behavior
The default source is still configured but without metadata. Agreements are reset for instance.
Actual behavior
The source is removed (dropped really).
Environment
> winget --info
Windows Package Manager v1.1.12702
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22474.1000
Package: Microsoft.DesktopAppInstaller v1.16.12702.0
Activity