Skip to content

Commit

Permalink
chore: implement cli input type
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmoellerdev committed Oct 8, 2024
1 parent bd39236 commit dd310b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion api/utils/blobaccess/git/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ func BlobAccess(opt ...Option) (_ bpi.BlobAccess, rerr error) {
}

// store the repo in a temporary filesystem subfolder, so the tgz can go in the root without issues.
if err := tmpFS.MkdirAll("repository", 0700); err != nil {
if err := tmpFS.MkdirAll("repository", 0o700); err != nil {
return nil, err
}

repositoryFS, err := projectionfs.New(tmpFS, "repository")
if err != nil {
return nil, err
Expand Down
15 changes: 10 additions & 5 deletions api/utils/blobaccess/git/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,16 @@ func (o *Options) ConfigureAuthMethod() error {
}
}

if o.CredentialContext.Value != nil {
creds, err := identity.GetCredentials(o.CredentialContext.Value, o.URL)
if err != nil {
return err
}
if o.CredentialContext.Value == nil {
return nil
}

creds, err := identity.GetCredentials(o.CredentialContext.Value, o.URL)
if err != nil {
return err
}

if creds != nil {
if o.ClientOptions.AuthMethod, err = git.AuthFromCredentials(creds); err != nil {
return err
}
Expand Down

0 comments on commit dd310b1

Please sign in to comment.