Skip to content

Commit d9a8004

Browse files
committed
libgit2: make RemoteCallbacks helper public
Main requirement for this is the image-automation-controller depending on being able to get a working auth configuration. Once the package is moved, we should add push logic to it, so that the controller is able to use that instead. Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent ee257f6 commit d9a8004

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/git/libgit2/checkout.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (c *CheckoutBranch) Checkout(ctx context.Context, path, url string, opts *g
6363
repo, err := git2go.Clone(url, path, &git2go.CloneOptions{
6464
FetchOptions: &git2go.FetchOptions{
6565
DownloadTags: git2go.DownloadTagsNone,
66-
RemoteCallbacks: remoteCallbacks(opts),
66+
RemoteCallbacks: RemoteCallbacks(opts),
6767
},
6868
CheckoutBranch: c.Branch,
6969
})
@@ -92,7 +92,7 @@ func (c *CheckoutTag) Checkout(ctx context.Context, path, url string, opts *git.
9292
repo, err := git2go.Clone(url, path, &git2go.CloneOptions{
9393
FetchOptions: &git2go.FetchOptions{
9494
DownloadTags: git2go.DownloadTagsAll,
95-
RemoteCallbacks: remoteCallbacks(opts),
95+
RemoteCallbacks: RemoteCallbacks(opts),
9696
},
9797
})
9898
if err != nil {
@@ -115,7 +115,7 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, opts *g
115115
repo, err := git2go.Clone(url, path, &git2go.CloneOptions{
116116
FetchOptions: &git2go.FetchOptions{
117117
DownloadTags: git2go.DownloadTagsNone,
118-
RemoteCallbacks: remoteCallbacks(opts),
118+
RemoteCallbacks: RemoteCallbacks(opts),
119119
},
120120
})
121121
if err != nil {
@@ -146,7 +146,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, opts *g
146146
repo, err := git2go.Clone(url, path, &git2go.CloneOptions{
147147
FetchOptions: &git2go.FetchOptions{
148148
DownloadTags: git2go.DownloadTagsAll,
149-
RemoteCallbacks: remoteCallbacks(opts),
149+
RemoteCallbacks: RemoteCallbacks(opts),
150150
},
151151
})
152152
if err != nil {

pkg/git/libgit2/transport.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ var (
3939
now = time.Now
4040
)
4141

42-
// remoteCallbacks constructs RemoteCallbacks with credentialsCallback and
42+
// RemoteCallbacks constructs RemoteCallbacks with credentialsCallback and
4343
// certificateCallback, and the given options if the given opts is not nil.
44-
func remoteCallbacks(opts *git.AuthOptions) git2go.RemoteCallbacks {
44+
func RemoteCallbacks(opts *git.AuthOptions) git2go.RemoteCallbacks {
4545
if opts != nil {
4646
return git2go.RemoteCallbacks{
4747
CredentialsCallback: credentialsCallback(opts),

0 commit comments

Comments
 (0)