Skip to content

Commit bd2b930

Browse files
committed
Preserve quoted leading and trailing single-line whitespace
At least in a single line, whitespace in a double-quoted value in a configuration file, like `name = " abc def "`, would presumably be intended. This removes the `strip()` call that is applied to text `ConfigParser` obtained by removing the double quotes around it. This slightly refines the changes in #2035 by dropping the `strip()` call while continuing to remove opening and closing double quotes.
1 parent 5f30320 commit bd2b930

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def string_decode(v: str) -> str:
509509
is_multi_line = True
510510
optval = string_decode(optval[1:])
511511
elif len(optval) > 1 and optval[0] == '"' and optval[-1] == '"':
512-
optval = optval[1:-1].strip()
512+
optval = optval[1:-1]
513513
# END handle multi-line
514514
# Preserves multiple values for duplicate optnames.
515515
cursect.add(optname, optval)

0 commit comments

Comments
 (0)