Skip to content

refactor(@angular/cli): standardize update command git utility execution - #32134

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:cli/update-git-helpers
Dec 16, 2025
Merged

refactor(@angular/cli): standardize update command git utility execution#32134
clydin merged 1 commit into
angular:mainfrom
clydin:cli/update-git-helpers

Conversation

@clydin

Copy link
Copy Markdown
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.
@clydin
clydinforce-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
@clydin
clydin merged commit b103f3b into angular:mainDec 16, 2025
36 checks passed
@clydin

Copy link
Copy Markdown
MemberAuthor

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
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-botangular-automatic-lock-botBot locked and limited conversation to collaborators Jan 16, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

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