Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 11a403e

Browse files
committed
Submodule.Update, add Auth to SubmoduleUpdateOption, fixes #520
1 parent e4a931c commit 11a403e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

options.go

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ type SubmoduleUpdateOptions struct {
194194
// the current repository but also in any nested submodules inside those
195195
// submodules (and so on). Until the SubmoduleRescursivity is reached.
196196
RecurseSubmodules SubmoduleRescursivity
197+
// Auth credentials, if required, to use with the remote repository.
198+
Auth transport.AuthMethod
197199
}
198200

199201
var (

submodule.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (s *Submodule) fetchAndCheckout(
218218
ctx context.Context, r *Repository, o *SubmoduleUpdateOptions, hash plumbing.Hash,
219219
) error {
220220
if !o.NoFetch {
221-
err := r.FetchContext(ctx, &FetchOptions{})
221+
err := r.FetchContext(ctx, &FetchOptions{Auth: o.Auth})
222222
if err != nil && err != NoErrAlreadyUpToDate {
223223
return err
224224
}

0 commit comments

Comments
 (0)