Skip to content

Don't show incorrect "cant find commit" error (especially in agents window) - #8931

Merged
Alex Ross (alexr00) merged 1 commit into
mainfrom
alexr00/bare-porcupine
Sep 7, 2026
Merged

Alex Ross (alexr00) merged 1 commit into
mainfrom
alexr00/bare-porcupine

Conversation

@alexr00

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 7, 2026 08:37
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) September 7, 2026 08:37
@alexr00 Alex Ross (alexr00) self-assigned this Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The change is small, targeted, and includes tests validating the new behavior; the only feedback is a minor localization consistency improvement.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​view/​gitContentProvider.ts — The user-facing error message here isn't localized, while other messages in this provider use…
What changed in this PR

This PR prevents a misleading “couldn’t find … locally” error from being shown when a review URI points at a repository root that is no longer part of the active workspace (e.g., after switching workspaces, including scenarios like the agents window).

Changes:

  • Gate the “couldn’t find an open repository…” UI error behind a vscode.workspace.getWorkspaceFolder(...) check, and log a debug message when skipping due to the repo no longer being in the workspace.
  • Add unit tests to verify the error is suppressed for previous-workspace paths and still shown for current-workspace paths.
File Description
src/​view/​gitContentProvider.ts Avoids showing an error toast when the requested repo root is no longer in the active workspace; logs debug instead.
src/​test/​view/​gitContentProvider.test.ts Adds coverage for the new workspace-vs-previous-workspace behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

if (!repository) {
vscode.window.showErrorMessage(`We couldn't find an open repository for ${commit} locally.`);
if (vscode.workspace.getWorkspaceFolder(vscode.Uri.file(rootPath))) {
vscode.window.showErrorMessage(`We couldn't find an open repository for ${commit} locally.`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point?

@alexr00
Alex Ross (alexr00) merged commit 6a43865 into main Sep 7, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/bare-porcupine branch September 7, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants