Skip to content

Commit

Permalink
feat: add v0.0.0 tag management
Browse files Browse the repository at this point in the history
  • Loading branch information
b4nst committed Aug 2, 2021
1 parent da8b6c2 commit d8c0c4b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/mod/cache/fetch.go
Expand Up @@ -62,11 +62,14 @@ func fetch(lang, mod, ver string) error {

func fetchGit(lang, remote, owner, repo, tag string) error {
FS := memfs.New()

gco := &git.CloneOptions{
URL: "https://" + remote + "/" + owner + "/" + repo,
SingleBranch: true,
ReferenceName: plumbing.NewTagReferenceName(tag),
Depth: 1,
URL: fmt.Sprintf("https://%s/%s/%s", remote, owner, repo),
Depth: 1,
}
if tag != "v0.0.0" {
gco.ReferenceName = plumbing.NewTagReferenceName(tag)
gco.SingleBranch = true
}

if _, err := git.Clone(memory.NewStorage(), FS, gco); err != nil {
Expand Down

0 comments on commit d8c0c4b

Please sign in to comment.