Part of #52. Depends on the shared git-invocation helper sub-issue.
Goal
Add a command to stash changes (git stash push) — ObjectiveGit's
Backup-Changes — with -KeepIndex, -IncludeUntracked, -All, and
-Message, modernized.
Modernize (do not port as-is)
- ObjectiveGit builds the command string and runs it via
Invoke-Expression.
Use the shared helper with a git argument array.
- Add
[CmdletBinding(SupportsShouldProcess)]; honor -WhatIf/-Confirm.
- Fix latent bugs while porting:
- The
-IncludeUntracked flag is built as --include--untracked (double dash,
wrong flag) — should be --include-untracked.
-Message is a [string] tested with -ne $null; use an
empty/whitespace check and pass -m <message> properly.
- Prefer
git stash push over the deprecated git stash save.
- Cross-platform repository path handling; drop the magic exit-code / bug branch.
Acceptance criteria
- Exported from both the
.psm1 and .psd1 export lists.
- Comment-based help;
SupportsShouldProcess honored.
- Final command name uses an approved verb and fits the module surface.
- README command table +
[Unreleased] CHANGELOG updated.
- Deterministic Pester tests (temp repo with a dirty working tree).
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 stash changes (
git stash push) — ObjectiveGit'sBackup-Changes— with-KeepIndex,-IncludeUntracked,-All, and-Message, modernized.Modernize (do not port as-is)
Invoke-Expression.Use the shared helper with a git argument array.
[CmdletBinding(SupportsShouldProcess)]; honor-WhatIf/-Confirm.-IncludeUntrackedflag is built as--include--untracked(double dash,wrong flag) — should be
--include-untracked.-Messageis a[string]tested with-ne $null; use anempty/whitespace check and pass
-m <message>properly.git stash pushover the deprecatedgit stash save.Acceptance criteria
.psm1and.psd1export lists.SupportsShouldProcesshonored.[Unreleased]CHANGELOG updated.build/Test-Modules.ps1andbuild/Invoke-Tests.ps1pass.