Skip to content

Commit 09a96fb

Browse files
committed
add test case for submodule depth parameter
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
1 parent 809c791 commit 09a96fb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎git/test/test_submodule.py

+8
Original file line numberDiff line numberDiff line change
@@ -936,3 +936,11 @@ class Repo(object):
936936
relative_path = Submodule._to_relative_path(super_repo, submodule_path)
937937
msg = '_to_relative_path should be "submodule_path" but was "%s"' % relative_path
938938
assert relative_path == 'submodule_path', msg
939+
940+
@with_rw_directory
941+
def test_depth(self, rwdir):
942+
parent = git.Repo.init(osp.join(rwdir, 'test_depth'))
943+
sm_name = 'mymodules/myname'
944+
sm_depth = 1
945+
sm = parent.create_submodule(sm_name, sm_name, url=self._small_repo_url(), depth=sm_depth)
946+
assert len(list(sm.module().iter_commits())) == sm_depth

0 commit comments

Comments
 (0)