Skip to content

Commit 52682c5

Browse files
committed
Add "DeleteTag" before "CreateTag" to avoid "ErrTagExists"
1 parent 19e63bb commit 52682c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/src/bashbrew/git.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ func (r Repo) fetchGitRepo(arch string, entry *manifest.Manifest2822Entry) (stri
242242
return "", err
243243
}
244244

245-
_, err = gitRepo.CreateTag(arch+"/"+r.RepoName+"/"+entry.Tags[0], goGitPlumbing.NewHash(commit), nil)
245+
gitTag := arch+"/"+r.RepoName+"/"+entry.Tags[0]
246+
gitRepo.DeleteTag(gitTag) // avoid "ErrTagExists"
247+
_, err = gitRepo.CreateTag(gitTag, goGitPlumbing.NewHash(commit), nil)
246248
if err != nil {
247249
return "", err
248250
}

0 commit comments

Comments
 (0)