aboutsummaryrefslogtreecommitdiffstats
path: root/submodule_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'submodule_test.go')
-rw-r--r--submodule_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/submodule_test.go b/submodule_test.go
index 4bae544..a8a0681 100644
--- a/submodule_test.go
+++ b/submodule_test.go
@@ -233,3 +233,32 @@ func (s *SubmoduleSuite) TestSubmodulesUpdateContext(c *C) {
err = sm.UpdateContext(ctx, &SubmoduleUpdateOptions{Init: true})
c.Assert(err, NotNil)
}
+
+func (s *SubmoduleSuite) TestSubmodulesFetchDepth(c *C) {
+ if testing.Short() {
+ c.Skip("skipping test in short mode.")
+ }
+
+ sm, err := s.Worktree.Submodule("basic")
+ c.Assert(err, IsNil)
+
+ err = sm.Update(&SubmoduleUpdateOptions{
+ Init: true,
+ Depth: 1,
+ })
+ c.Assert(err, IsNil)
+
+ r, err := sm.Repository()
+ c.Assert(err, IsNil)
+
+ lr, err := r.Log(&LogOptions{})
+ c.Assert(err, IsNil)
+
+ commitCount := 0
+ for _, err := lr.Next(); err == nil; _, err = lr.Next() {
+ commitCount++
+ }
+ c.Assert(err, IsNil)
+
+ c.Assert(commitCount, Equals, 1)
+}