mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 16:44:42 +04:00
Fix non-ascii merge commit messages in python2
This commit is contained in:
parent
e3b14c35f7
commit
964948b33d
3 changed files with 18 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: UTF-8 -*-
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
|
@ -190,6 +191,18 @@ def test_commit_am(tempdir_factory):
|
|||
assert ret == 0
|
||||
|
||||
|
||||
def test_unicode_merge_commit_message(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
assert install(Runner(path, C.CONFIG_FILE)) == 0
|
||||
cmd_output('git', 'checkout', 'master', '-b', 'foo')
|
||||
cmd_output('git', 'commit', '--allow-empty', '-m', 'branch2')
|
||||
cmd_output('git', 'checkout', 'master')
|
||||
cmd_output('git', 'merge', 'foo', '--no-ff', '--no-commit', '-m', '☃')
|
||||
# Used to crash
|
||||
cmd_output('git', 'commit', '--no-edit')
|
||||
|
||||
|
||||
def test_install_idempotent(tempdir_factory):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ def test_get_conflicted_files_unstaged_files(in_merge_conflict):
|
|||
assert ret == {'conflict_file'}
|
||||
|
||||
|
||||
MERGE_MSG = "Merge branch 'foo' into bar\n\nConflicts:\n\tconflict_file\n"
|
||||
OTHER_MERGE_MSG = MERGE_MSG + '\tother_conflict_file\n'
|
||||
MERGE_MSG = b"Merge branch 'foo' into bar\n\nConflicts:\n\tconflict_file\n"
|
||||
OTHER_MERGE_MSG = MERGE_MSG + b'\tother_conflict_file\n'
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue