Skip to content

Commit

Permalink
fix bootstrap for Azure DevOps (#594)
Browse files Browse the repository at this point in the history
Signed-off-by: Seunghyun Hwang <[email protected]>
  • Loading branch information
lesomnus authored Oct 4, 2024
1 parent 48fb06f commit 54e177d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/git/provider_ado.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package git

import (
"context"
"crypto/tls"
"fmt"
"net/url"
"strings"
Expand Down Expand Up @@ -52,7 +53,9 @@ func newAdo(opts *ProviderOptions) (Provider, error) {
return nil, err
}

connection.TlsConfig.RootCAs = rootCAs
connection.TlsConfig = &tls.Config{
RootCAs: rootCAs,
}
ctx, cancel := context.WithTimeout(context.Background(), timeoutTime)
defer cancel()
// FYI: ado also has a "core" client that can be used to update project, teams, and other ADO constructs
Expand Down Expand Up @@ -97,7 +100,10 @@ func (g *adoGit) GetDefaultBranch(ctx context.Context, orgRepo string) (string,
if err != nil {
return "", err
}

if r.DefaultBranch == nil {
// Repo is empty.
return "main", nil
}
return *r.DefaultBranch, nil
}

Expand Down

0 comments on commit 54e177d

Please sign in to comment.