FetchOne: consider order of create/delete events when replicating deletions

The previous logic for detecting which refs had to be deleted as a result
of a replication queue refspecs to be replicated did not take into
consideration the order of the create/delete events for the same ref.

As a result, the multiple create+delete of the same ref was potentially
causing missed replication events as it was only resulting into a
deletion.

Example:
1. create refs/foo/bar + delete refs/foo/bar => delete refs/foo/bar
2. delete refs/foo/bar + create refs/foo/bar => create refs/foo/bar

The step 2. was resulting into a delete refs/foo/bar instead of a create.

Make the extraction of the refs to delete more intelligent so that
all operations are considered and properly calculated in order for
getting the final results of the create + delete of the same ref.

Bug: Issue 394760809
Change-Id: I83d3b38cbb8e3391ca7af2af8ddea245258c4413
3 files changed
tree: 7f22bccf2f91e0e8f20ed38afaa2c58527017fbd
  1. example-setup/
  2. src/
  3. .gitignore
  4. BUILD
  5. Jenkinsfile
  6. LICENSE