Skip to content

🐛 --changed throws No such file or directory when file is deleted #4952

@Loskir

Description

@Loskir

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.17.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/9.6.7"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

  1. git checkout main
  2. echo "const a=1" > test.ts
  3. git commit -m "1"
  4. git checkout -b test
  5. echo "const a=2" > test.ts
  6. git commit -m "2"
  7. mv test.ts test2.ts
  8. npx biome check --changed
test.ts internalError/io  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ No such file or directory (os error 2)
  
  ⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.

Expected result

Should not show an error

I get that --changed is supposed to be used in CI, but it can also be useful locally, e.g. for precommit checks. Probably it should treat uncommited local changes the same way as commits

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: CLIS-Bug-confirmedStatus: report has been confirmed as a valid buggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions