When we updated gitlab_git to 10.4.1, `tag.target` changed from pointing
to the sha of the tag to the sha of the commit the tag points to. The
problem is that only annotated tags have `object_sha`s, lightweight tags
don't (it's nil), so (only) in their case we still need to use
`tag.target`.
Similar to 423d2d6, except duplicates occurred only if a Web service (e.g. Slack) were
configured.
When deleting a branch, this is what was happening:
1. DeleteBranchService calls execute_hooks and execute_services
2. The call to repository.rm_branch triggers the GitHooksService.
3. This, in turn, calls GitPushService and then calls the same hooks/services again.
5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to execute
the branch hooks/services. Note that tags behave differently in GitTagPushService and GitPushService
is not called.
Closes#10330
When deleting a branch, this is what was happening:
1. DeleteBranchService calls EventCreateService and creates an event.
2. The call to repository.rm_branch triggers the GitHooksService.
3. This, in turn, calls GitPushService and then calls EventCreateService again.
5145706c now makes it no longer necessary for DeleteBranchService and CreateBranchService to create an event.
Closes#4304