gemini-cli PR: Git Quoted Paths Silently Skipped Sensitive-Keyword Linting

HermanGrondahl · ghdev · 2026-12-05

A PR to Google's gemini-cli fixes a subtle bug: scripts/lint.js selected changed files via git diff --name-only and split on newlines, but Git quotes/escapes unusual pathnames, so the linter received a quoted representation that doesn't exist on disk — and the existsSync guard skipped the file before ever checking it for the forbidden model id.

The fix switches to NUL-separated output (git diff -z) and extracts a single diffNames(range) helper shared by the merge-base path and the HEAD1..HEAD fallback, so the two can't drift apart again. The author explains why core.quotePath=false was deliberately left out: under -z the flag is a no-op.

The new test spins up real git repos and runs the real linter as a subprocess, covering filenames with spaces, newlines, quotes, backslashes and Unicode, plus added/modified/deleted files, asserting on the linter's actual output.

Original post →

More from coding & agent

coding & agent channel →