Skip to content

fix: friendly error when not in a git repo - #261

Merged
ajianaz merged 1 commit into
developfrom
fix/minor-ux-improvements
Jun 11, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/minor-ux-improvements

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

Running cora review --staged outside a git repo shows a confusing raw git error:

Error: git command `diff --cached` failed: error: unknown option `cached`

Fix

Detect common git errors in stderr and return CoraError::NotInGitRepo instead:

Error: not inside a git repository

Testing

  • 506 tests pass
  • Clippy clean
  • Manual validation: cora review --staged in non-git directory shows friendly error

Detect common git errors (not a git repo, unknown option cached)
and return CoraError::NotInGitRepo instead of raw git stderr.

Before: 'git command diff --cached failed: error: unknown option cached'
After:  'not inside a git repository'

506 tests pass, clippy clean.
@ajianaz
ajianaz merged commit 51a40f4 into develop Jun 11, 2026
10 checks passed
@ajianaz
ajianaz deleted the fix/minor-ux-improvements branch June 11, 2026 08:55
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.

1 participant