include auth when fetching specific specs (#1796)

Signed-off-by: ygelfand <yuri@shlitz.com>
This commit is contained in:
ygelfand 2021-12-23 11:36:19 -05:00 committed by GitHub
parent 2cb0387758
commit b3ec974cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -96,6 +96,7 @@ func (g *Git) UnpackTarFromBuildContext() (string, error) {
if fetchRef != "" {
err = r.Fetch(&git.FetchOptions{
RemoteName: "origin",
Auth: getGitAuth(),
RefSpecs: []config.RefSpec{config.RefSpec(fetchRef + ":" + fetchRef)},
})
if err != nil && !errors.Is(err, git.NoErrAlreadyUpToDate) {