diff options
author | Michael Mercier <michael.mercier@ryax.tech> | 2021-03-16 10:00:51 +0100 |
---|---|---|
committer | Michael Mercier <michael.mercier@ryax.tech> | 2021-03-16 10:16:34 +0100 |
commit | ffddedf5467df993b7a42fbd15afacb901bca6d7 (patch) | |
tree | b43ffc85ba78261e9446e5a9446de82054d707dc /git/util.py | |
parent | 50cbafc690e5692a16148dbde9de680be70ddbd1 (diff) | |
download | gitpython-ffddedf5467df993b7a42fbd15afacb901bca6d7.tar.gz |
Use copy and not inplace remove password + working case test
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git/util.py b/git/util.py index 80985df4..907c6998 100644 --- a/git/util.py +++ b/git/util.py @@ -349,7 +349,9 @@ def remove_password_if_present(cmdline): This should be used for every log line that print a command line. """ + new_cmdline = [] for index, to_parse in enumerate(cmdline): + new_cmdline.append(to_parse) try: url = urlsplit(to_parse) # Remove password from the URL if present @@ -358,11 +360,11 @@ def remove_password_if_present(cmdline): edited_url = url._replace( netloc=url.netloc.replace(url.password, "*****")) - cmdline[index] = urlunsplit(edited_url) + new_cmdline[index] = urlunsplit(edited_url) except ValueError: # This is not a valid URL pass - return cmdline + return new_cmdline #} END utilities |