-
Notifications
You must be signed in to change notification settings - Fork 843
Open
Labels
Needs triageTicket needs to be triagedTicket needs to be triaged[Pri] Low[Status] Auto-allocated[Type] BugWhen a feature is broken and / or not performing as intendedWhen a feature is broken and / or not performing as intended
Description
Impacted plugin
None / Other
Quick summary
The package fails on Windows systems when running with --git options, throwing a fatal Git error about paths existing on disk but not in the index.
Environment
- OS: Windows (confirmed on 2 different laptops)
- Package version: 2.1.4
- Git: Git CLI (native Windows installation)
- Context: Running via lint-staged in a pre-commit hook
Trace (run with lint-staged)
✔ Backed up original state in git stash (9bbcfe76e)
⚠ Running tasks for staged files...
❯ lint-staged.config.mjs — 1 file
❯ *.ts — 1 file
✔ node scripts/eslint-fix-silent.js
✖ npx @automattic/eslint-changed --git --ext .ts [FAILED]
◼ prettier --write
↓ *.html — no files
↓ *.{json,css,scss,md} — no files
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ npx @automattic/eslint-changed --git --ext .ts:
fatal: path 'app\src\app\path\to\file.ts' exists on disk, but not in the index
error: git exited with status 128
Error: lint-staged failed
husky - pre-commit script failed (code 1)
Steps to reproduce
- On a Windows system, create or modify a TypeScript file in a Git repository
- Stage the file:
git add path/to/file.ts - Run the command:
npx @automattic/eslint-changed --git --git-unstaged --ext .ts
Expected Behavior
The tool should successfully lint the staged changes without errors, as it does on Linux.
Actual Behavior
The command fails with:
fatal: path 'app\src\app\path\to\file.ts' exists on disk, but not in the index
error: git exited with status 128
Site owner impact
Fewer than 20% of the total website/platform users
Severity
Minor
What other impact(s) does this issue have?
No revenue impact
Additional information
- The same setup works perfectly on Linux
- The error specifically occurs when Git is asked to interact with a path that uses Windows-style backslashes (
\) - Git on Windows uses forward slashes (
/) in its output, but the error message shows the path with backslashes - This suggests a path separator normalization issue between Git's output format and Windows file system operations
Platform (Simple and/or Atomic)
No response
Metadata
Metadata
Assignees
Labels
Needs triageTicket needs to be triagedTicket needs to be triaged[Pri] Low[Status] Auto-allocated[Type] BugWhen a feature is broken and / or not performing as intendedWhen a feature is broken and / or not performing as intended
Type
Projects
Status
Triage