* Get the list of protected file paths that currently have staged changes. * @returns {string[]} Array of relative paths for protected files that are staged; empty if none.
()
| 61 | * @returns {string[]} Array of relative paths for protected files that are staged; empty if none. |
| 62 | */ |
| 63 | function getTouchedProtectedFiles() { |
| 64 | const output = git([ |
| 65 | 'diff', |
| 66 | '--cached', |
| 67 | '--name-only', |
| 68 | '-z', |
| 69 | '--', |
| 70 | ...PROTECTED_FILES |
| 71 | ]); |
| 72 | return output.split('\0').filter(Boolean); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Determine whether a file should be normalized (text formatting enforced) based on its path. |