Skip to content

Explicit empty --path falls back to the whole repository #2016

Open

Description

@pqminh27

OpenCodeReview Version

v0.0.0-6441246 (commit 6441246; source build)

Operating System

macOS (Apple Silicon)

Installation Method

Built from source

LLM Provider

Anthropic (Claude) is configured; this --preview reproduction does not call the provider.

Bug Description

An explicitly empty --path is treated as if the flag were omitted. ocr scan then previews the whole repository, and --output can overwrite an existing file. Whitespace-only and comma-only selectors behave the same way.

Steps to Reproduce

In a Git repository with two committed Go files, run:

out=$(mktemp)
printf 'keep\n' > "$out"
ocr scan --preview --format json --path '' --output "$out"
printf 'exit=%s\n' "$?"
cat "$out"

On the reported version, the command exits 0 and replaces the file with a preview containing both files.

Expected Behavior

Reject an explicitly empty selector with an error before writing the output file. Omitting --path should continue to scan the whole repository.

AI/LLM Disclosure

OpenAI Codex (GPT-6) assisted with the investigation and related code change. Claude Sonnet 5 completed the repository-required OCR review; it found no issues in the production file.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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