This also affects `git_index_add_bypath()` by providing a better error message and a specific error code when a directory is passed.