File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ def get_root() -> str:
5252 # "rev-parse --show-cdup" to get the appropriate path, but must perform
5353 # an extra check to see if we are in the .git directory.
5454 try :
55- root = os .path .realpath (
55+ root = os .path .abspath (
5656 cmd_output ('git' , 'rev-parse' , '--show-cdup' )[1 ].strip (),
5757 )
58- git_dir = os .path .realpath (get_git_dir ())
58+ git_dir = os .path .abspath (get_git_dir ())
5959 except CalledProcessError :
6060 raise FatalError (
6161 'git failed. Is it installed, and are you in a Git repository '
Original file line number Diff line number Diff line change 77import pre_commit .constants as C
88from pre_commit import main
99from pre_commit .errors import FatalError
10+ from pre_commit .util import cmd_output
1011from testing .auto_namedtuple import auto_namedtuple
12+ from testing .util import cwd
1113
1214
1315@pytest .mark .parametrize (
@@ -54,6 +56,17 @@ def test_adjust_args_and_chdir_relative_things(in_git_dir):
5456 assert args .files == [os .path .join ('foo' , 'f1' ), os .path .join ('foo' , 'f2' )]
5557
5658
59+ @pytest .mark .skipif (os .name != 'nt' , reason = 'windows feature' )
60+ def test_install_on_subst (in_git_dir , store ): # pragma: posix no cover
61+ assert not os .path .exists ('Z:' )
62+ cmd_output ('subst' , 'Z:' , str (in_git_dir ))
63+ try :
64+ with cwd ('Z:' ):
65+ test_adjust_args_and_chdir_noop ('Z:\\ ' )
66+ finally :
67+ cmd_output ('subst' , '/d' , 'Z:' )
68+
69+
5770def test_adjust_args_and_chdir_non_relative_config (in_git_dir ):
5871 in_git_dir .join ('foo' ).ensure_dir ().chdir ()
5972
You can’t perform that action at this time.
0 commit comments