diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 9dd439347..08d30ee79 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -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