| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,12 +238,16 @@ def test_clone_from_keeps_env(self, rw_dir): | |||
| 238 | 238 | @with_rw_directory | |
| 239 | 239 | def test_clone_from_drive_rooted_destination(self, rw_dir): | |
| 240 | 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 | 241 | ||
| 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) | ||
| 245 | 247 | ||
| 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) | ||
| 247 | 251 | ||
| 248 | 252 | @with_rw_directory | |
| 249 | 253 | def test_date_format(self, rw_dir): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments