Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Dec 16, 2025

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.
@clydin clydin force-pushed the cli/update-git-helpers branch from 0578dfe to 7ecaef7 Compare December 16, 2025 00:31
@alan-agius4 alan-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
@clydin clydin merged commit b103f3b into angular:main Dec 16, 2025
36 checks passed
@clydin
Copy link
Member Author

clydin commented Dec 16, 2025

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

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

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants