File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -849,7 +849,20 @@ func codesignBinary(binPath string) error {
849849 return cmd .Run ()
850850}
851851
852- // cleanExtensionUpdateDir deletes extension state directory to avoid problems reinstalling extensions.
852+ // cleanExtensionUpdateDir deletes the extension-specific directory containing metadata used in checking for updates.
853+ // Because extension names are not unique across GitHub organizations and users, we feel its important to clean up this metadata
854+ // before installing or removing an extension with the same name to avoid confusing the extension manager based on past extensions.
855+ //
856+ // As of cli/cli#9934, the only effect on gh from not cleaning up metadata before installing or removing an extension are:
857+ //
858+ // 1. The last `checked_for_update_at` timestamp is sufficiently in the past and will check for an update on first use,
859+ // which would happen if no extension update metadata existed.
860+ //
861+ // 2. The last `checked_for_update_at` timestamp is sufficiently in the future and will not check for an update,
862+ // this is not a major concern as users could manually modify this.
863+ //
864+ // This could change over time as other functionality is added to extensions, which we cannot predict within cli/cli#9934,
865+ // such as extension manifest and lock files within cli/cli#6118.
853866func (m * Manager ) cleanExtensionUpdateDir (name string ) error {
854867 if err := os .RemoveAll (m .UpdateDir (name )); err != nil {
855868 return fmt .Errorf ("failed to remove previous extension update state: %w" , err )
You can’t perform that action at this time.
0 commit comments