* Execute a git command safely using execFileSync (array args — never shell-interpolated). * @param {string[]} args - Git arguments as an array (e.g. ['diff', '--name-only', 'HEAD']) * @returns {string} stdout, trimmed. Empty string on error.
(args)
| 222 | * @returns {string} stdout, trimmed. Empty string on error. |
| 223 | */ |
| 224 | function gitExec(args) { |
| 225 | try { |
| 226 | return execFileSync('git', args, { cwd: ROOT, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim(); |
| 227 | } catch { |
| 228 | return ''; |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | function getCurrentHead() { |
| 233 | return gitExec(['rev-parse', 'HEAD']); |
no outgoing calls
no test coverage detected