Skip to content

Commit

Permalink
replace only when there is secret, remove logging from subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Izquierdo committed Nov 2, 2023
1 parent 7f3870f commit e9a7c77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aap_eda/services/project/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit e9a7c77

Please sign in to comment.