Prevent misleading Invalid id' error in logs
Upon git ref updates, pull-replication is fired so that remotes are
notified to perform a new fetch operation.
Small commits however (for configurable values of "small") can already
be sent as part of the payload in order to save one round-trip and be
passed directly instead.
For this reason, for each updated ref, an attempt is made to extract the
commit from the update ref.
Upon failure however, a non-useful, error message spamming the logs, as
such:
```
org.eclipse.jgit.errors.InvalidObjectIdException: Invalid id
```
Without giving any detail on what ref or what objectId actually caused
the exception, this entry is quite useless.
This was the case for example, in a multi-site installation, where the
```refs/multi-site/version```
ref was failing to be extracted (since the ref points to a blob rather
than a commit).
in fact, in a multi-site deployment this ref should be added to the
```replication.excludeRefs``` section.
Catch the InvalidObjectIdException and provide contextual information on
which ref, exactly, failed.
Bug: 14741
Change-Id: Ib0ed6f4606c72738de9296be353c4d88a2f3a88b
2 files changed