Commit c07abd65 by Carson Howard

submodule: add better error handling to is_path_occupied

parent b282ca79
......@@ -176,7 +176,10 @@ static int is_path_occupied(bool *occupied, git_repository *repo, const char *pa
if ((error = git_path_to_dir(&dir)) < 0)
goto out;
if ((error = git_index_find_prefix(NULL, index, dir.ptr)) == 0) {
if ((error = git_index_find_prefix(NULL, index, dir.ptr)) < 0 && error != GIT_ENOTFOUND)
goto out;
if (!error) {
giterr_set(GITERR_SUBMODULE,
"Directory '%s' already exists in the index", path);
*occupied = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment