The metadata transfer and hooks can be relatively time consuming, so they should be skipped when sync fails or the server timestamp has not changed.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_564988 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/341e483d8597cbbab383758a368fa79c
Some people might be working under the assumption that emerge --sync will *always* call their hook, in order to trigger some system administration tasks that have little or nothing to do with the sync operation itself. It's impossible to speculate how many people might be relying on this sort of behavior. So, I'll think about exposing an environment variable to the hooks which will allow them to decide if anything relevant has changed.
It should be safe enough to just skip the metadata transfer.
New patch: https://archives.gentoo.org/gentoo-portage-dev/message/0be639bb9bede8d98991ac4dbbdc5916
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d984cea6ee08799f003b189e934f696b483e101a
I've posted a patch for GitSync: https://archives.gentoo.org/gentoo-portage-dev/message/b2929c6895056d147311efcb41c53f44
This git patch is in master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9921cfeb51ab8d9dc128aa5e927d29fc675b28b4
Released in 2.2.25.