Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_config_settings: Avoid break with multiline configs #624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -1688,9 +1688,11 @@ class GitUtils(object):
except subprocess.CalledProcessError as e: # pragma: no cover
raise SystemExit('fatal: {}'.format(e))

configs = map(lambda x: x.strip().split(b'=', maxsplit=1), output.splitlines())
# FIXME: Ignores multi-line values, just take the first line for now
configs = filter(lambda x: len(x) == 2, configs)
# FIXME: Ignores multi-valued keys, just let them overwrite for now
return dict(line.split(b'=', maxsplit=1)
for line in output.strip().split(b"\n"))
return dict(configs)

@staticmethod
def get_blob_sizes(quiet = False):
Expand Down