Skip to content

[Bug]: Delete dialog says "No uncommitted changes" when the git status check failed #43678

Closed

Description

@gethubguy

Operating system

Windows 11 with WSL2 (project opened via \\wsl.localhost\<distro>\...)

Orca version

1.4.261

Details

What happens

The Delete dialog for a worktree reports "No uncommitted changes" even when Orca's own uncommitted-changes check failed. A failed check is shown as a clean result.

Seen on a worktree that had been removed outside Orca (a ghost row, see #10951), so the folder no longer existed. When the Delete dialog opened, main.trace.ndjson logged both checks failing in that folder:

git.argv_shape: "status --porcelain"  caller: status-read  exit: Failure ("Git command failed")
git.argv_shape: "ls-files -z"         exit: Failure ("Git command failed")

The dialog still read:

No uncommitted changes
Ignored files could not be fully checked

Steps to reproduce

  1. Add a Git project located in WSL; create a worktree for it.
  2. In a WSL shell, git worktree remove --force <path> (the row stays, per [Feature]: Reconcile sidebar worktree records with the filesystem — externally deleted worktrees linger as permanent ghost rows #10951).
  3. Open the row's Delete dialog.
  4. The dialog says "No uncommitted changes" although git status failed.

Expected

When the status check fails, the dialog says the changes could not be checked (as it already does for ignored files), or says the folder no longer exists. It should never show "No uncommitted changes" without a successful check.

Why it matters

Here the folder was already gone, so nothing was at risk. But any other reason git status can fail (a slow or unreachable WSL mount, a locked index, a permission error) would show a worktree holding real unsaved work as safe to delete.

Activity

  1. self-assigned this
    on Nov 17, 2026
  2. added a commit that references this issue on Nov 17, 2026
    3093b73
  3. added a commit that references this issue on Nov 17, 2026
    1a7ae55
  4. Pr1p commented on Nov 17, 2026

    @Pr1p
    Contributor

    Taking this. Root cause is in the dialog's status hydration, not the status layer: the store intentionally keeps the last known list when a read fails (gitStatusReadErrorByWorktree, set by setGitStatus), but the delete dialog's useDeleteWorktreeStatusHydration trusted that cached list whenever one existed — so a worktree whose folder was removed outside Orca still carried its pre-removal clean [], and the dialog rendered 'complete' with 0 changes while git status was failing.

    Fix: a cached list is only trusted when its last read succeeded (new cachedDeleteStatusIsTrustworthy); otherwise the dialog runs its own fresh check, which publishes null on failure and shows the existing 'Changes could not be checked' copy. PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions