Skip to content

Commit

Permalink
tests: add test for clone(shallow_branch=...)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Mar 16, 2022
1 parent 9f36ffc commit 9891e36
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_scmrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 9891e36

Please sign in to comment.