summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py6
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