Correctly handle exclude patterns in git_hook