Prevent tagging existing remote versions.

This commit is contained in:
Marcin Bilski
2021-12-22 15:35:09 +01:00
parent e08d238243
commit 52d4a68d86
3 changed files with 21 additions and 10 deletions

View File

@@ -352,7 +352,10 @@ func (api *api) tag(w http.ResponseWriter, r *http.Request, module, version stri
return
}
taggable.Tag(vcs.Version(version), req.Short)
// TODO(bilus): Response
err = taggable.Tag(r.Context(), vcs.Version(version), req.Short)
if err != nil {
api.log("api.tag", "module", module, "version", version, "error", err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
}