fix(#4081): decode git C-quoted paths in codebase-drift --name-status parser (#4307)

* test(#4081): failing-first regression for quotepath C-quoted paths in codebase-drift

* fix(#4081): decode git C-quoted paths in codebase-drift --name-status parse

* test(#4081): set drift_threshold 1 so decoded-path test triggers action_required

* chore(#4081): add changeset fragment

* chore(#4081): fix changeset fragment formatting

* chore(#4081): backfill PR number in changeset

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-05 00:50:35 -04:00
committed by GitHub
parent 9ee6d54cc3
commit eb336e9f77
4 changed files with 139 additions and 1 deletions

View File

@@ -674,6 +674,11 @@ const SUMMARY_ARTIFACT_SUFFIX = 'SUMMARY.md';
* (a trailing lone backslash, or an octal escape with fewer than three
* digits) never throws — it degrades to treating the character literally, so
* a single bad path can never take down the whole cleanup wave.
*
* Exported (#4081) so the codebase-drift gate's `--name-status` parser can
* decode the identical C-quoted form before classifying paths — the gate's
* `execGit` call sets no `core.quotepath` config, so it receives the same
* quoting and must decode it with the same single owner of this seam.
*/
function decodeGitQuotedPath(raw: string): string {
if (raw.length < 2 || !raw.startsWith('"') || !raw.endsWith('"')) return raw;
@@ -2303,6 +2308,9 @@ function pruneOrphanedWorktrees(repoRoot: string, deps: WorktreeDeps & { writeEr
}
export = {
// Re-exported for the codebase-drift gate's --name-status parser (#4081):
// single owner of git C-quoted-path decoding.
decodeGitQuotedPath,
resolveWorktreeContext,
resolveWorktreeLinkage,
parseWorktreePorcelain,