Add "DeleteTag" before "CreateTag" to avoid "ErrTagExists"

This commit is contained in:
Tianon Gravi 2019-06-14 14:47:39 -07:00
parent 19e63bbaeb
commit 52682c57a3
1 changed files with 3 additions and 1 deletions

View File

@ -242,7 +242,9 @@ func (r Repo) fetchGitRepo(arch string, entry *manifest.Manifest2822Entry) (stri
return "", err
}
_, err = gitRepo.CreateTag(arch+"/"+r.RepoName+"/"+entry.Tags[0], goGitPlumbing.NewHash(commit), nil)
gitTag := arch+"/"+r.RepoName+"/"+entry.Tags[0]
gitRepo.DeleteTag(gitTag) // avoid "ErrTagExists"
_, err = gitRepo.CreateTag(gitTag, goGitPlumbing.NewHash(commit), nil)
if err != nil {
return "", err
}