core.hooksPath: add some protection while cloning