mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Remove private key requirement for tmpfs-mode
This commit is contained in:
parent
1a7b44d9f3
commit
4b798ecec8
@ -111,10 +111,16 @@ func mn(_ *cobra.Command, _ []string) {
|
||||
}
|
||||
lastKeyLocation = filepath.Join(usr.HomeDir, ".ssh/id_rsa")
|
||||
}
|
||||
// create ssh key authenticator
|
||||
authenticator, err := ssh.NewPublicKeysFromFile(sshUser, lastKeyLocation, "")
|
||||
if err != nil {
|
||||
log.Fatalf("could not get git authenticator: %v", err)
|
||||
|
||||
var authenticator *ssh.PublicKeys
|
||||
|
||||
if tmpFsMode == "" {
|
||||
var err error
|
||||
// create ssh key authenticator
|
||||
authenticator, err = ssh.NewPublicKeysFromFile(sshUser, lastKeyLocation, "")
|
||||
if err != nil {
|
||||
log.Fatalf("could not get git authenticator: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
fsCreator := func(branch string) billy.Filesystem {
|
||||
|
@ -119,27 +119,25 @@ func (g *GitMode) RetrieveSource(pd *data.ProcessData) *data.ModeData {
|
||||
}
|
||||
_ = tagIter.ForEach(tagAdd)
|
||||
|
||||
if len(latestTags) == 0 {
|
||||
list, err := remote.List(&git.ListOptions{})
|
||||
list, err := remote.List(&git.ListOptions{})
|
||||
if err != nil {
|
||||
log.Fatalf("could not list upstream: %v", err)
|
||||
}
|
||||
|
||||
for _, ref := range list {
|
||||
if ref.Hash().IsZero() {
|
||||
continue
|
||||
}
|
||||
|
||||
commit, err := repo.CommitObject(ref.Hash())
|
||||
if err != nil {
|
||||
log.Fatalf("could not list upstream: %v", err)
|
||||
}
|
||||
|
||||
for _, ref := range list {
|
||||
if ref.Hash().IsZero() {
|
||||
continue
|
||||
}
|
||||
|
||||
commit, err := repo.CommitObject(ref.Hash())
|
||||
if err != nil {
|
||||
log.Printf("could not get commit object for ref %s: %v", ref.Name().String(), err)
|
||||
continue
|
||||
}
|
||||
_ = tagAdd(&object.Tag{
|
||||
Name: strings.TrimPrefix(string(ref.Name()), "refs/tags/"),
|
||||
Tagger: commit.Committer,
|
||||
})
|
||||
log.Printf("could not get commit object for ref %s: %v", ref.Name().String(), err)
|
||||
continue
|
||||
}
|
||||
_ = tagAdd(&object.Tag{
|
||||
Name: strings.TrimPrefix(string(ref.Name()), "refs/tags/"),
|
||||
Tagger: commit.Committer,
|
||||
})
|
||||
}
|
||||
|
||||
for _, branch := range latestTags {
|
||||
|
Loading…
Reference in New Issue
Block a user