From e9a7c7798080a48af6c6537c524556c9e85f9b70 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Nov 2023 18:17:56 +0100 Subject: [PATCH] replace only when there is secret, remove logging from subprocess --- src/aap_eda/services/project/git.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aap_eda/services/project/git.py b/src/aap_eda/services/project/git.py index ad642f2ad..c8421e759 100644 --- a/src/aap_eda/services/project/git.py +++ b/src/aap_eda/services/project/git.py @@ -153,7 +153,9 @@ def clone( try: _executor(cmd) except GitError as e: - msg = str(e).replace(secret, "****") + msg = str(e) + if secret: + msg = str(e).replace(secret, "****") logger.warning("Git clone failed: %s", msg) raise GitError(msg) from e return cls(path, _executor=_executor) @@ -205,4 +207,4 @@ def __call__( usr_msg = f"Command git failed with return code {e.returncode}. " if e.stderr: usr_msg += f"Error: {e.stderr}" - raise GitError(usr_msg) from e + raise GitError(usr_msg) from None