fix(client/go): correct tag-go-module dirty-tree guard; GOPRIVATE docs (Client.Go-028,029)
This commit is contained in:
@@ -39,10 +39,14 @@ if ($Version -notmatch '^v\d+\.\d+\.\d+(-[A-Za-z0-9.-]+)?$') {
|
||||
$tag = "clients/go/$Version"
|
||||
Write-Host "Creating Go-module tag: $tag" -ForegroundColor Cyan
|
||||
|
||||
# Verify we're on a clean checkout — refuse to tag with uncommitted changes.
|
||||
$status = (git status --porcelain) -join "`n"
|
||||
if ($status -and -not ($status -match '^\?\?')) {
|
||||
throw "Working tree has tracked changes. Commit or stash before tagging."
|
||||
# Verify we're on a clean checkout — refuse to tag with uncommitted tracked
|
||||
# changes. Test each porcelain line individually: any entry that is not an
|
||||
# untracked file (`??`) is a tracked change, regardless of how the entries
|
||||
# happen to sort. Joining and anchoring `^\?\?` against the whole blob would
|
||||
# only inspect the first line and miss tracked changes behind an untracked one.
|
||||
$dirty = (git status --porcelain) | Where-Object { $_ -and ($_ -notmatch '^\?\?') }
|
||||
if ($dirty) {
|
||||
throw "Working tree has tracked changes. Commit or stash before tagging.`n$($dirty -join "`n")"
|
||||
}
|
||||
|
||||
# Verify the tag doesn't already exist.
|
||||
|
||||
Reference in New Issue
Block a user