Record sanitized Git diagnostics for publication recovery
This commit is contained in:
1 parent
d5ec18f05b
commit
2615cf113d
1 file changed
+6
@@ -191,6 +191,12 @@ def publish(args):
|
||||
# Commands never contain the credential; do not print captured HTTP/Git output.
|
||||
failure = f"{type(error).__name__}: {error}"
|
||||
state["failure"] = failure
|
||||
if isinstance(error, subprocess.CalledProcessError) and error.stderr:
|
||||
detail = error.stderr.decode("utf-8", "replace")
|
||||
if token:
|
||||
detail = detail.replace(token, "[REDACTED]")
|
||||
detail = detail.replace(base64.b64encode(("gerardo:" + token).encode()).decode(), "[REDACTED]")
|
||||
state["safe_command_stderr"] = detail[-4000:]
|
||||
finally:
|
||||
if stop is not None:
|
||||
stop.set()
|
||||
|
||||
Reference in new issue
Block a user