mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Fix try-repo relpath while in a sub-directory
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user