Factor out hook executing logic to utils
Try git operations on update only in git repos