mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Fix try-repo relpath while in a sub-directory
This commit is contained in:
parent
b31cb22d8b
commit
4da461d90a
2 changed files with 15 additions and 0 deletions
|
|
@ -47,6 +47,17 @@ def test_adjust_args_and_chdir_non_relative_config(in_git_dir):
|
|||
assert args.config == C.CONFIG_FILE
|
||||
|
||||
|
||||
def test_adjust_args_try_repo_repo_relative(in_git_dir):
|
||||
in_git_dir.join('foo').ensure_dir().chdir()
|
||||
|
||||
args = Args(command='try-repo', repo='../foo', files=[])
|
||||
assert os.path.exists(args.repo)
|
||||
main._adjust_args_and_chdir(args)
|
||||
assert os.getcwd() == in_git_dir
|
||||
assert os.path.exists(args.repo)
|
||||
assert args.repo == 'foo'
|
||||
|
||||
|
||||
FNS = (
|
||||
'autoupdate', 'clean', 'install', 'install_hooks', 'migrate_config', 'run',
|
||||
'sample_config', 'uninstall',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue