Anthony Sottile | 8f61529 | 2022-01-15 19:24:05 -0500 | [diff] [blame] | 1 | from __future__ import annotations |
| 2 | |
gkisel | c682b50 | 2015-01-07 14:07:32 -0800 | [diff] [blame] | 3 | import pytest |
Anthony Sottile | 713fab4 | 2015-03-20 13:52:21 -0700 | [diff] [blame] | 4 | |
| 5 | from pre_commit_hooks.util import cmd_output |
gkisel | c682b50 | 2015-01-07 14:07:32 -0800 | [diff] [blame] | 6 | |
| 7 | |
Anthony Sottile | 4ab7914 | 2018-01-21 15:31:23 -0800 | [diff] [blame] | 8 | @pytest.fixture |
gkisel | c682b50 | 2015-01-07 14:07:32 -0800 | [diff] [blame] | 9 | def temp_git_dir(tmpdir): |
Anthony Sottile | a99475a | 2016-05-27 14:09:50 -0700 | [diff] [blame] | 10 | git_dir = tmpdir.join('gits') |
Max Rozentsveyg | f35bfed | 2020-05-20 12:07:45 -0400 | [diff] [blame] | 11 | cmd_output('git', 'init', '--', str(git_dir)) |
gkisel | c682b50 | 2015-01-07 14:07:32 -0800 | [diff] [blame] | 12 | yield git_dir |