Avoid duplicate remote tag lookups
Co-authored-by: Mislav Marohnić <hi@mislav.net>
This commit is contained in:
parent
f1a067ff18
commit
fad72b788d
1 changed files with 2 additions and 3 deletions
|
|
@ -228,9 +228,8 @@ func createRun(opts *CreateOptions) error {
|
|||
}
|
||||
}
|
||||
|
||||
var remoteTagPresent bool
|
||||
if opts.VerifyTag && !existingTag {
|
||||
remoteTagPresent, err = remoteTagExists(httpClient, baseRepo, opts.TagName)
|
||||
remoteTagPresent, err := remoteTagExists(httpClient, baseRepo, opts.TagName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -251,7 +250,7 @@ func createRun(opts *CreateOptions) error {
|
|||
// of local tag status.
|
||||
// If a remote tag with the same name as specified exists already
|
||||
// then a new tag will not be created so ignore local tag status.
|
||||
if tagDescription != "" && !existingTag && opts.Target == "" && !remoteTagPresent {
|
||||
if tagDescription != "" && !existingTag && opts.Target == "" && !opts.VerifyTag {
|
||||
remoteExists, err := remoteTagExists(httpClient, baseRepo, opts.TagName)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue