mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Add authenticator to all Git calls (makes it possible to have private repos)
This commit is contained in:
parent
102ff0427a
commit
70c4c22665
@ -82,6 +82,7 @@ func (g *GitMode) RetrieveSource(pd *data.ProcessData) (*data.ModeData, error) {
|
||||
}
|
||||
|
||||
err = remote.Fetch(&git.FetchOptions{
|
||||
Auth: pd.Authenticator,
|
||||
RefSpecs: []config.RefSpec{refspec},
|
||||
Tags: git.AllTags,
|
||||
Force: true,
|
||||
@ -120,7 +121,9 @@ func (g *GitMode) RetrieveSource(pd *data.ProcessData) (*data.ModeData, error) {
|
||||
}
|
||||
_ = tagIter.ForEach(tagAdd)
|
||||
|
||||
list, err := remote.List(&git.ListOptions{})
|
||||
list, err := remote.List(&git.ListOptions{
|
||||
Auth: pd.Authenticator,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not list upstream: %v", err)
|
||||
}
|
||||
@ -180,6 +183,7 @@ func (g *GitMode) WriteSource(pd *data.ProcessData, md *data.ModeData) error {
|
||||
}
|
||||
pd.Log.Printf("checking out upstream refspec %s", refspec)
|
||||
err = remote.Fetch(&git.FetchOptions{
|
||||
Auth: pd.Authenticator,
|
||||
RemoteName: "upstream",
|
||||
RefSpecs: []config.RefSpec{refspec},
|
||||
Tags: git.AllTags,
|
||||
|
@ -128,6 +128,7 @@ func executePatchesRpm(pd *data.ProcessData, md *data.ModeData) error {
|
||||
}
|
||||
|
||||
fetchOptions := &git.FetchOptions{
|
||||
Auth: pd.Authenticator,
|
||||
RemoteName: "origin",
|
||||
RefSpecs: []config.RefSpec{refspec},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user