diff --git a/tests/test_scmrepo.py b/tests/test_scmrepo.py index 86c85346..b6f9140d 100644 --- a/tests/test_scmrepo.py +++ b/tests/test_scmrepo.py @@ -18,3 +18,13 @@ def test_clone(tmp_dir: TmpDir, matcher: Type[Matcher]): progress.assert_called_with(matcher.instance_of(GitProgressEvent)) assert (tmp_dir / "dir").exists() + + +def test_clone_shallow(tmp_dir: TmpDir): + url = "https://github.com/iterative/dvcyaml-schema" + shallow_branch = "master" + + repo = Git.clone(url, "dir", shallow_branch=shallow_branch) + shallow_file = tmp_dir / "dir" / ".git" / "shallow" + assert shallow_file.exists() + assert repo.get_rev() in shallow_file.read_text().splitlines()