61e7176bf0
Change I80ad478522 added an unconditional check for the 'Create Reference' permission in ReceiveCommands#parseCreate(...). Checking this permission on push of annotated tags is wrong as pushing annotated tags (for commits that already exist in the Gerrit repository) should (only) require the 'Create Annotated Tag' permission. The correct permission checks for pushing new branches and tags are implemented in RefControl#canCreate(...) and this method is also invoked from ReceiveCommands#parseCreate(...). This means we can simply drop the check for the 'Create Reference' permission in ReceiveCommands#parseCreate(...) as RefControl#canCreate(...) will check for this permission too, if it's needed (for pushing new branches and lightweight tags). This problem was not discovered by the PushTagIT because tests for pushing lightweight and annotated tags were executed in a loop. For testing pushing of lightweight tags the 'Create Reference' permission was assigned and it was still there when pushing of annotated tags was tested. To fix this PushTagIT is split into 2 tests, PushAnnotatedTagIT and PushLightweightTagIT. Change-Id: I656febfb71e9fb7d1e805c1a63ca9c32405b57e6 Signed-off-by: Edwin Kempin <ekempin@google.com>