Skip to content

Title: Regression in v0.0.94+: explicit file comparison broken when run inside a git repository #251

@harvey251

Description

@harvey251

Summary
Starting with v0.0.94, passing two explicit file paths to openapi-changes summary no longer performs a left/right file comparison when the command is run from inside a git repository. Instead, the tool silently switches to git history mode and fails with:

v0.0.93 works correctly with the same invocation.

Steps to reproduce
v0.0.93 → correct left/right diff output
v0.0.94 / v0.0.95 → cannot compare files, nothing was extracted
Expected behaviour
When two file path arguments are supplied, the tool should use left/right file comparison mode regardless of whether the working directory is inside a git repository.

Actual behaviour
The tool detects the git repository in the working directory and overrides the explicit file arguments, switching to git history mode. Running from a temp directory outside the repo was also tested on v0.0.95 and fails identically, suggesting the mode-detection no longer respects explicit file arguments at all.

Workaround
Pin to v0.0.93:

Environment
Versions tested: 0.0.93 ✅, 0.0.94 ❌, 0.0.95 ❌
OS: macOS / Ubuntu 22.04 (CI runner)
Use case: CI pipeline comparing a PR branch openapi.json against the main branch openapi.json (two explicit file paths, not a git history walk)

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