Skip to content

Conversation

@clydin
Copy link
Member

All git commands now use execFileSync instead of execSync to prevent shell injection vulnerabilities and provide more predictable execution. checkCleanGit now utilizes git status --porcelain -z for NUL-terminated output, ensuring correct handling of filenames with spaces or special characters, and preventing potential path trimming bugs. An execGit helper function was introduced to reduce code duplication and standardize git command execution options. hasChangesToCommit now gracefully handles non-Git repositories by returning false instead of throwing.

All `git` commands now use `execFileSync` instead of `execSync` to prevent shell injection vulnerabilities and provide more predictable execution. `checkCleanGit` now utilizes `git status --porcelain -z` for NUL-terminated output, ensuring correct handling of filenames with spaces or special characters, and preventing potential path trimming bugs. An `execGit` helper function was introduced to reduce code duplication and standardize `git` command execution options. `hasChangesToCommit` now gracefully handles non-Git repositories by returning `false` instead of throwing.
@clydinclydinforce-pushed the cli/update-git-helpers branch from 0578dfe to 7ecaef7CompareDecember 16, 2025 00:31
@alan-agius4alan-agius4 added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Dec 16, 2025
@clydinclydin merged commit b103f3b into angular:mainDec 16, 2025
36 checks passed
@clydin
Copy link
MemberAuthor

This PR was merged into the repository. The changes were merged into the following branches:

@clydinclydin deleted the cli/update-git-helpers branch December 16, 2025 14:01
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: mergeThe PR is ready for merge by the caretakerarea: @angular/clitarget: minorThis PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@clydin@alan-agius4