Skip to content

Commit 3a00a36

Browse files
committed
pytest_plugin(refactor): Use copytree_reflink in *_repo fixtures
what: - Update git_repo fixture to use copytree_reflink - Update hg_repo fixture to use copytree_reflink - Update svn_repo fixture to use copytree_reflink
1 parent c4b6004 commit 3a00a36

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libvcs/pytest_plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import pytest
1414

1515
from libvcs import exc
16+
from libvcs._internal.copy import copytree_reflink
1617
from libvcs._internal.run import _ENV, run
1718
from libvcs.sync.git import GitRemote, GitSync
1819
from libvcs.sync.hg import HgSync
@@ -706,7 +707,7 @@ def git_repo(
706707
master_copy = remote_repos_path / "git_repo"
707708

708709
if master_copy.exists():
709-
shutil.copytree(master_copy, new_checkout_path)
710+
copytree_reflink(master_copy, new_checkout_path)
710711
return GitSync(
711712
url=f"file://{git_remote_repo}",
712713
path=str(new_checkout_path),
@@ -740,7 +741,7 @@ def hg_repo(
740741
master_copy = remote_repos_path / "hg_repo"
741742

742743
if master_copy.exists():
743-
shutil.copytree(master_copy, new_checkout_path)
744+
copytree_reflink(master_copy, new_checkout_path)
744745
return HgSync(
745746
url=f"file://{hg_remote_repo}",
746747
path=str(new_checkout_path),
@@ -766,7 +767,7 @@ def svn_repo(
766767
master_copy = remote_repos_path / "svn_repo"
767768

768769
if master_copy.exists():
769-
shutil.copytree(master_copy, new_checkout_path)
770+
copytree_reflink(master_copy, new_checkout_path)
770771
return SvnSync(
771772
url=f"file://{svn_remote_repo}",
772773
path=str(new_checkout_path),

0 commit comments

Comments
 (0)