Fetch all references when cloning git source
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
3a8eecf378
commit
e3838621a9
|
@ -26,6 +26,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
|
"github.com/go-git/go-git/v5/config"
|
||||||
"github.com/go-git/go-git/v5/plumbing"
|
"github.com/go-git/go-git/v5/plumbing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -92,6 +93,13 @@ func (GitDownloader) Download(opts Options) (Type, string, error) {
|
||||||
return 0, "", err
|
return 0, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = r.Fetch(&git.FetchOptions{
|
||||||
|
RefSpecs: []config.RefSpec{"+refs/*:refs/*"},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return 0, "", err
|
||||||
|
}
|
||||||
|
|
||||||
if rev != "" {
|
if rev != "" {
|
||||||
h, err := r.ResolveRevision(plumbing.Revision(rev))
|
h, err := r.ResolveRevision(plumbing.Revision(rev))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue