File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,12 +238,16 @@ def test_clone_from_keeps_env(self, rw_dir):
238238 @with_rw_directory
239239 def test_clone_from_drive_rooted_destination (self , rw_dir ):
240240 original_repo = Repo .init (osp .join (rw_dir , "repo" ))
241- destination = osp .join (rw_dir , "clone" )
242- _drive , rooted_destination = osp .splitdrive (destination )
243241
244- cloned = Repo .clone_from (original_repo .git_dir , rooted_destination )
242+ # Drive-rooted paths resolve on the current drive. Keep the destination
243+ # there even when the system temporary directory uses another drive.
244+ with tempfile .TemporaryDirectory (dir = os .getcwd ()) as destination_root :
245+ destination = osp .join (destination_root , "clone" )
246+ _drive , rooted_destination = osp .splitdrive (destination )
245247
246- assert osp .samefile (cloned .working_tree_dir , destination )
248+ cloned = Repo .clone_from (original_repo .git_dir , rooted_destination )
249+
250+ assert osp .samefile (cloned .working_tree_dir , destination )
247251
248252 @with_rw_directory
249253 def test_date_format (self , rw_dir ):
You can’t perform that action at this time.
0 commit comments