Skip to content

Commit

Permalink
Merge branch 'th/fix-multiline-config-parsing'
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Newren <newren@gmail.com>
  • Loading branch information
newren committed Jan 28, 2025
2 parents 0ee22eb + 4697eeb commit 3528c65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -1683,14 +1683,14 @@ class GitUtils(object):
def get_config_settings(repo_working_dir):
output = ''
try:
output = subproc.check_output('git config --list'.split(),
output = subproc.check_output('git config --list --null'.split(),
cwd=repo_working_dir)
except subprocess.CalledProcessError as e: # pragma: no cover
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"))
return dict(item.split(b'\n', maxsplit=1)
for item in output.strip().split(b"\0") if item)

@staticmethod
def get_blob_sizes(quiet = False):
Expand Down
11 changes: 11 additions & 0 deletions t/t9390-filter-repo-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -895,4 +895,15 @@ test_expect_success 'origin refs without origin remote does not die' '
)
'

test_expect_success 'multi-line config value' '
test_create_repo multiline_config &&
(
cd multiline_config &&
git config set test.test "test
test" &&
git filter-repo --force
)
'

test_done

0 comments on commit 3528c65

Please sign in to comment.