diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-05-05 08:15:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 08:15:56 +0800 |
commit | b3166ece31bfb29e89f6ed4bb9214bf1c03791df (patch) | |
tree | ee9aa2356a5f57cf547580d56e2df3723df6c6df /git/exc.py | |
parent | d5cee4a467a0ab543c0a118cc763ad3a54b8fc69 (diff) | |
parent | 85fe2735b7c9119804813bcbbdd8d14018291ed3 (diff) | |
download | gitpython-b3166ece31bfb29e89f6ed4bb9214bf1c03791df.tar.gz |
Merge pull request #1437 from glennmatthews/issue-1284
Strip usernames from URLs as well as passwords
Diffstat (limited to 'git/exc.py')
-rw-r--r-- | git/exc.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -8,6 +8,7 @@ from gitdb.exc import BadName # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614 from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614 from git.compat import safe_decode +from git.util import remove_password_if_present # typing ---------------------------------------------------- @@ -54,7 +55,7 @@ class CommandError(GitError): stdout: Union[bytes, str, None] = None) -> None: if not isinstance(command, (tuple, list)): command = command.split() - self.command = command + self.command = remove_password_if_present(command) self.status = status if status: if isinstance(status, Exception): @@ -66,8 +67,8 @@ class CommandError(GitError): s = safe_decode(str(status)) status = "'%s'" % s if isinstance(status, str) else s - self._cmd = safe_decode(command[0]) - self._cmdline = ' '.join(safe_decode(i) for i in command) + self._cmd = safe_decode(self.command[0]) + self._cmdline = ' '.join(safe_decode(i) for i in self.command) self._cause = status and " due to: %s" % status or "!" stdout_decode = safe_decode(stdout) stderr_decode = safe_decode(stderr) |