GitReferenceUpdated: Add helper methods to get update type

The type of ref update is already known on the server before the ref
update event is fired. Pass this information into the event, so its
consumers can get it without having to perform operations on the git
repository.

Change-Id: I5d90a157c316ac0c2b65ba3deb2cc2f62628df8a
This commit is contained in:
David Pursehouse
2015-04-13 17:43:51 +09:00
parent c2ac351981
commit 414681fa42
8 changed files with 52 additions and 15 deletions

View File

@@ -165,8 +165,7 @@ class DeleteBranches implements RestModifyView<ProjectResource, Input> {
private void postDeletion(ProjectResource project, ReceiveCommand cmd)
throws OrmException {
referenceUpdated.fire(project.getNameKey(), cmd.getRefName(),
cmd.getOldId(), cmd.getNewId());
referenceUpdated.fire(project.getNameKey(), cmd);
Branch.NameKey branchKey =
new Branch.NameKey(project.getNameKey(), cmd.getRefName());
hooks.doRefUpdatedHook(branchKey, cmd.getOldId(), cmd.getNewId(),