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

filter-repo: Accept multiline git config values #632

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
5 changes: 3 additions & 2 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -1689,8 +1689,9 @@ class GitUtils(object):
raise SystemExit('fatal: {}'.format(e))

# 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"))
keyvalues = re.split(b'^([a-zA-Z0-9.-]+)=', output, flags=re.MULTILINE)
return {keyvalues[i].strip(): keyvalues[i + 1].strip()
for i in range(1, len(keyvalues), 2)}

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