Merge "CreateTag: document why we don't check for visibility"

This commit is contained in:
Han-Wen Nienhuys
2021-01-14 09:31:58 +00:00
committed by Gerrit Code Review

View File

@@ -102,6 +102,8 @@ public class CreateTag implements RestCollectionCreateView<ProjectResource, TagR
try (Repository repo = repoManager.openRepository(resource.getNameKey())) {
ObjectId revid = RefUtil.parseBaseRevision(repo, resource.getNameKey(), input.revision);
RevWalk rw = RefUtil.verifyConnected(repo, revid);
// Reachability through tags does not influence a commit's visibility, so no need to check for
// visibility.
RevObject object = rw.parseAny(revid);
rw.reset();
boolean isAnnotated = Strings.emptyToNull(input.message) != null;