{"record":{"id":"59ecfcb4028f8bc1","repo":"LykosAI/StabilityMatrix","slug":"git-installation-canceled","errorCode":null,"errorMessage":"Git installation canceled","messagePattern":"Git installation canceled","errorType":"exception","errorClass":"OperationCanceledException","httpStatus":null,"severity":"warning","filePath":"StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs","lineNumber":262,"sourceCode":"                        Text = \"The current operation requires Git. Please install it to continue.\",\n                    },\n                    new SelectableTextBlock { Text = \"$ sudo apt install git\" },\n                },\n            },\n            PrimaryButtonText = Resources.Action_Retry,\n            CloseButtonText = Resources.Action_Close,\n            DefaultButton = ContentDialogButton.Primary,\n        };\n\n        while (true)\n        {\n            // Return if installed\n            if (await CheckIsGitInstalled())\n                return;\n            if (await dialog.ShowAsync() == ContentDialogResult.None)\n            {\n                // Cancel\n                throw new OperationCanceledException(\"Git installation canceled\");\n            }\n            // Otherwise continue to retry indefinitely\n        }\n    }\n\n    /// <inheritdoc />\n    public Task RunGit(\n        ProcessArgs args,\n        Action<ProcessOutput>? onProcessOutput = null,\n        string? workingDirectory = null\n    )\n    {\n        // Async progress not supported on Unix\n        return RunGit(args, workingDirectory);\n    }\n\n    private async Task RunGit(ProcessArgs args, string? workingDirectory = null)\n    {","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs#L244-L280","documentation":"InstallGitIfNecessary loops while git is not installed: it shows a dialog asking to install git. If the user closes/dismisses the dialog (result None) the method throws OperationCanceledException('Git installation canceled') to abort the surrounding package install, since git is required to clone/update packages.","triggerScenarios":"Installing/updating a package on Linux when git is not on PATH, and the user clicks 'Cancel'/closes the ContentDialog instead of installing git.","commonSituations":"Fresh Linux install without git present; user declines the prompted installation and the package install aborts; first-run package setup on minimal distros.","solutions":["Install git system-wide (e.g. sudo apt install git / dnf install git) and re-run the package install.","If the dialog appears again, choose to install git rather than canceling.","Dismissal is intentional cancellation — retry the operation and accept the prompt to proceed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!await helper.CheckIsGitInstalled())\n    return; // skip git-dependent install or pre-install git","typeGuard":null,"tryCatchPattern":"try { await helper.InstallGitIfNecessary(); }\ncatch (OperationCanceledException ex) when (ex.Message == \"Git installation canceled\")\n{ logger.Info(\"User declined git install; aborting package install gracefully.\"); }","preventionTips":["Install git before first package setup: sudo apt install git / dnf install git.","Accept the install prompt when it appears instead of canceling.","Treat OperationCanceledException here as user intent, not a bug."],"tags":["git","operation-canceled","user-canceled","prerequisites","linux"],"backgroundTag":"missing-dependency","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}