Part of #52. Depends on the shared git-invocation helper sub-issue.
Goal
Add a command to set a git config value (ObjectiveGit's Set-Config), with
-Location local/global/system — modernized.
Modernize (do not port as-is)
- ObjectiveGit builds
"git -C $Repository config --$Location $Property \"$Value\"" and runs it via
Invoke-Expression — property/value are interpolated into the command string.
Use the shared helper with a git argument array.
- Add
[CmdletBinding(SupportsShouldProcess)]; honor -WhatIf/-Confirm
(changes persistent config, possibly --global/--system).
- Keep the
-Location ValidateSet('local','global','system'); the original's
bespoke exit-code mapping (1/3/4) can be simplified — surface git's
stderr via the shared helper.
- Cross-platform path handling.
Acceptance criteria
- Exported from both the
.psm1 and .psd1 export lists.
- Comment-based help;
SupportsShouldProcess honored.
- Property/value passed as discrete arguments (never interpolated into a command
string); final command name uses an approved verb.
- README command table +
[Unreleased] CHANGELOG updated.
- Deterministic Pester tests (temp repo; set + read back a
--local value;
assert -WhatIf writes nothing).
build/Test-Modules.ps1 and build/Invoke-Tests.ps1 pass.
Part of #52. Depends on the shared git-invocation helper sub-issue.
Goal
Add a command to set a git config value (ObjectiveGit's
Set-Config), with-Location local/global/system— modernized.Modernize (do not port as-is)
"git -C $Repository config --$Location $Property \"$Value\""and runs it viaInvoke-Expression— property/value are interpolated into the command string.Use the shared helper with a git argument array.
[CmdletBinding(SupportsShouldProcess)]; honor-WhatIf/-Confirm(changes persistent config, possibly
--global/--system).-LocationValidateSet('local','global','system'); the original'sbespoke exit-code mapping (
1/3/4) can be simplified — surface git'sstderr via the shared helper.
Acceptance criteria
.psm1and.psd1export lists.SupportsShouldProcesshonored.string); final command name uses an approved verb.
[Unreleased]CHANGELOG updated.--localvalue;assert
-WhatIfwrites nothing).build/Test-Modules.ps1andbuild/Invoke-Tests.ps1pass.