diff options
author | Liam Beguin <liambeguin@gmail.com> | 2020-05-02 15:31:03 -0400 |
---|---|---|
committer | Liam Beguin <liambeguin@gmail.com> | 2020-05-02 16:08:58 -0400 |
commit | 09a96fb2ea908e20d5acb7445d542fa2f8d10bb6 (patch) | |
tree | 9b53f734f5baa2b78f7f199b963b27cd86fd5496 /git/test/test_submodule.py | |
parent | 809c7911944bc32223a41ea3cecc051d698d0503 (diff) | |
download | gitpython-09a96fb2ea908e20d5acb7445d542fa2f8d10bb6.tar.gz |
add test case for submodule depth parameter
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r-- | git/test/test_submodule.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 9dd43934..08d30ee7 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -936,3 +936,11 @@ class TestSubmodule(TestBase): 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 |