aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--options.go2
-rw-r--r--submodule.go2
2 files changed, 3 insertions, 1 deletions
diff --git a/options.go b/options.go
index 9f328cb..0ec18d4 100644
--- a/options.go
+++ b/options.go
@@ -194,6 +194,8 @@ type SubmoduleUpdateOptions struct {
// the current repository but also in any nested submodules inside those
// submodules (and so on). Until the SubmoduleRescursivity is reached.
RecurseSubmodules SubmoduleRescursivity
+ // Auth credentials, if required, to use with the remote repository.
+ Auth transport.AuthMethod
}
var (
diff --git a/submodule.go b/submodule.go
index fbaddfd..b5de41f 100644
--- a/submodule.go
+++ b/submodule.go
@@ -218,7 +218,7 @@ func (s *Submodule) fetchAndCheckout(
ctx context.Context, r *Repository, o *SubmoduleUpdateOptions, hash plumbing.Hash,
) error {
if !o.NoFetch {
- err := r.FetchContext(ctx, &FetchOptions{})
+ err := r.FetchContext(ctx, &FetchOptions{Auth: o.Auth})
if err != nil && err != NoErrAlreadyUpToDate {
return err
}