There was an error while loading. Please reload this page.
1 parent 923e6a0 commit b2e9b16Copy full SHA for b2e9b16
1 file changed
test/test_repo.py
@@ -238,12 +238,16 @@ def test_clone_from_keeps_env(self, rw_dir):
238
@with_rw_directory
239
def test_clone_from_drive_rooted_destination(self, rw_dir):
240
original_repo = Repo.init(osp.join(rw_dir, "repo"))
241
- destination = osp.join(rw_dir, "clone")
242
- _drive, rooted_destination = osp.splitdrive(destination)
243
244
- cloned = Repo.clone_from(original_repo.git_dir, rooted_destination)
+ # Drive-rooted paths resolve on the current drive. Keep the destination
+ # there even when the system temporary directory uses another drive.
+ with tempfile.TemporaryDirectory(dir=os.getcwd()) as destination_root:
245
+ destination = osp.join(destination_root, "clone")
246
+ _drive, rooted_destination = osp.splitdrive(destination)
247
- 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)
251
252
253
def test_date_format(self, rw_dir):
0 commit comments