Skip to content

Commit

Permalink
add test case for submodule depth parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Beguin <[email protected]>
  • Loading branch information
liambeguin committed May 2, 2020
1 parent 809c791 commit 09a96fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions git/test/test_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,3 +936,11 @@ class Repo(object):
relative_path = Submodule._to_relative_path(super_repo, submodule_path)
msg = '_to_relative_path should be "submodule_path" but was "%s"' % relative_path
assert relative_path == 'submodule_path', msg

@with_rw_directory
def test_depth(self, rwdir):
parent = git.Repo.init(osp.join(rwdir, 'test_depth'))
sm_name = 'mymodules/myname'
sm_depth = 1
sm = parent.create_submodule(sm_name, sm_name, url=self._small_repo_url(), depth=sm_depth)
assert len(list(sm.module().iter_commits())) == sm_depth

0 comments on commit 09a96fb

Please sign in to comment.