mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Improve git_commit helper
This commit is contained in:
parent
28c97a95cd
commit
160a11a0a7
10 changed files with 75 additions and 84 deletions
|
|
@ -31,7 +31,7 @@ def test_get_root_not_git_dir(in_tmpdir):
|
|||
def test_get_staged_files_deleted(in_git_dir):
|
||||
in_git_dir.join('test').ensure()
|
||||
cmd_output('git', 'add', 'test')
|
||||
cmd_output('git', 'commit', '-m', 'foo', '--allow-empty')
|
||||
git_commit()
|
||||
cmd_output('git', 'rm', '--cached', 'test')
|
||||
assert git.get_staged_files() == []
|
||||
|
||||
|
|
@ -105,11 +105,11 @@ def test_parse_merge_msg_for_conflicts(input, expected_output):
|
|||
|
||||
|
||||
def test_get_changed_files(in_git_dir):
|
||||
git_commit('initial commit')
|
||||
git_commit()
|
||||
in_git_dir.join('a.txt').ensure()
|
||||
in_git_dir.join('b.txt').ensure()
|
||||
cmd_output('git', 'add', '.')
|
||||
git_commit('add some files')
|
||||
git_commit()
|
||||
files = git.get_changed_files('HEAD', 'HEAD^')
|
||||
assert files == ['a.txt', 'b.txt']
|
||||
|
||||
|
|
@ -133,10 +133,10 @@ def test_zsplit(s, expected):
|
|||
|
||||
@pytest.fixture
|
||||
def non_ascii_repo(in_git_dir):
|
||||
git_commit('initial commit')
|
||||
git_commit()
|
||||
in_git_dir.join('интервью').ensure()
|
||||
cmd_output('git', 'add', '.')
|
||||
git_commit('initial commit')
|
||||
git_commit()
|
||||
yield in_git_dir
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue