Bug 1247171 - Handle git config items with a line feed
--- a/git/commands/git-mozreview
+++ b/git/commands/git-mozreview
@@ -160,24 +160,25 @@ def get_output(args):
try:
output = subprocess.check_output(args, stderr=subprocess.STDOUT)
return 0, output
except subprocess.CalledProcessError as e:
return e.returncode, e.output
def get_git_config():
- res, output = get_output(['git', 'config', '--list'])
+ res, output = get_output(['git', 'config', '--list', '-z'])
if res:
raise AbortError('could not obtain git config')
c = {}
- for line in output.splitlines():
- k, v = line.split('=', 1)
- c[k] = v
+ for line in output.split('\0'):
+ if line:
+ k, v = line.split('\n', 1)
+ c[k] = v
return c
def get_commit_info(commits):
"""Obtain info about Git commits.
A list of 2-tuples of commits in topological order oldest to newest will