Commit f0ab9fda by Vicent Marti

index: Return `GIT_ENOTFOUND` when an entry cannot be opened

parent d102bbba
...@@ -427,7 +427,7 @@ static int index_init_entry(git_index_entry *entry, git_index *index, const char ...@@ -427,7 +427,7 @@ static int index_init_entry(git_index_entry *entry, git_index *index, const char
git_path_join(full_path, index->repository->path_workdir, rel_path); git_path_join(full_path, index->repository->path_workdir, rel_path);
if (p_lstat(full_path, &st) < 0) if (p_lstat(full_path, &st) < 0)
return git__throw(GIT_EOSERR, "Failed to initialize entry. '%s' cannot be opened", full_path); return git__throw(GIT_ENOTFOUND, "Failed to initialize entry. '%s' cannot be opened", full_path);
if (stage < 0 || stage > 3) if (stage < 0 || stage > 3)
return git__throw(GIT_ERROR, "Failed to initialize entry. Invalid stage %i", stage); return git__throw(GIT_ERROR, "Failed to initialize entry. Invalid stage %i", stage);
......
...@@ -341,6 +341,9 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid) ...@@ -341,6 +341,9 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid)
if (os->full) if (os->full)
return GIT_ENOMEM; return GIT_ENOMEM;
if (text_oid == NULL)
return os->min_length;
idx = 0; idx = 0;
is_leaf = 0; is_leaf = 0;
......
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