sync: BOWEI_US 2026-09-02

This commit is contained in:
Myfro9
2026-09-02 15:37:47 -05:00
parent 67ca51b2c2
commit f1d36bb082
2 changed files with 14 additions and 7 deletions
+11 -4
View File
@@ -52,10 +52,17 @@ function Invoke-Doctor([string]$Why) {
if (-not (Test-Path $doctor)) { Write-Host "gitea_doctor.ps1 not found; cannot repair the server."; return $false }
Write-Host ""
Write-Host "=== gitea transport check/repair ($Why) ==="
$dargs = @("-RepoUrl", $RepoUrl, "-Fix")
if ($AllowDestructive) { $dargs += "-AllowDestructive" }
& $doctor @dargs
$ok = ($LASTEXITCODE -eq 0)
# Hashtable splat, not an array: splatting an array passes every element
# positionally, so "-Fix" would be bound as a value (it lands on -SshTimeout).
$dargs = @{ RepoUrl = $RepoUrl; Fix = $true }
if ($AllowDestructive) { $dargs["AllowDestructive"] = $true }
$ok = $false
try {
& $doctor @dargs
$ok = ($LASTEXITCODE -eq 0)
} catch {
Write-Host "doctor could not be invoked: $($_.Exception.Message)"
}
Write-Host "=== doctor $(if ($ok) { 'reports the transport healthy' } else { 'could NOT restore the transport' }) ==="
Write-Host ""
return $ok