aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.go
diff options
context:
space:
mode:
authormatej.risek <matej.risek@hashicorp.com>2023-05-04 09:04:23 +0200
committermatej.risek <matej.risek@hashicorp.com>2023-05-04 09:04:23 +0200
commitecc9fe45b6261492c0cfdcdb1ff4e642252d6694 (patch)
tree141642f1ebc5e5bc2b6435a54c33e55c00bcec7a /submodule.go
parentb154dcce7059e4e02f8798db158b6a76ffc4a63e (diff)
downloadgo-git-ecc9fe45b6261492c0cfdcdb1ff4e642252d6694.tar.gz
git: Add Depth to SubmoduleUpdateOptions
Diffstat (limited to 'submodule.go')
-rw-r--r--submodule.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/submodule.go b/submodule.go
index a202a9b..b0c4169 100644
--- a/submodule.go
+++ b/submodule.go
@@ -243,7 +243,7 @@ func (s *Submodule) fetchAndCheckout(
ctx context.Context, r *Repository, o *SubmoduleUpdateOptions, hash plumbing.Hash,
) error {
if !o.NoFetch {
- err := r.FetchContext(ctx, &FetchOptions{Auth: o.Auth})
+ err := r.FetchContext(ctx, &FetchOptions{Auth: o.Auth, Depth: o.Depth})
if err != nil && err != NoErrAlreadyUpToDate {
return err
}
@@ -265,6 +265,7 @@ func (s *Submodule) fetchAndCheckout(
err := r.FetchContext(ctx, &FetchOptions{
Auth: o.Auth,
RefSpecs: []config.RefSpec{refSpec},
+ Depth: o.Depth,
})
if err != nil && err != NoErrAlreadyUpToDate && err != ErrExactSHA1NotSupported {
return err