Reuse Gerrit code for head update To avoid code duplication and to make sure that head update is done correctly replace pull-replication custom code with the code from Gerrit core. Bug: Issue 15396 Change-Id: Ic49b731a8e5394ead3a4d36134db7a38f068718d