You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[plan] Fix copy vs rename handling and double-quoted filenames in push_signed_commits.cjs #26253
Fix two related bugs in actions/setup/js/push_signed_commits.cjs related to diff parsing.
Context
Reported in issue #26156. The push_signed_commits.cjs file has incorrect handling of file status parsing from git diff --name-status.
Bugs to Fix
1. Copy entries treated as renames (line 125-129)
Currently, when a file status starts with C (copy), the old file is added to deletions. This is wrong — a copy keeps the original file. Only renames (R) should delete the old path.
// WRONG: deletes old file for copies too}elseif(status.startsWith("R")||status.startsWith("C")){deletions.push({path: parts[1]});// ← should not happen for copies
Fix: Only add the old path to deletions when status starts with R, not C.
2. C-quoted (double-quoted) filenames not handled (lines 113-134)
git diff may C-quote filenames containing special characters (spaces, unicode, etc.) by surrounding them with double-quotes and escaping special characters. The code doesn't handle this.
Fix: Switch from git diff to git diff-tree (more stable, not affected by user git config), and add a helper to unescape C-quoted filenames (strip surrounding ", unescape \\n, \\t, \\\\, \\", octal sequences, etc.).
Activity