Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-05-06 17:45:53 +0400
committerVicent Martí <vicent@github.com>2013-05-06 17:45:53 +0400
commit03c28d92d00074f1501cb0d7ce9f5e3e0154a244 (patch)
tree64c394dc10a839fd0766a800ff31a1d0236360d6 /src/index.c
parentd5e5bbd7193924aa845e107f747a15814a679b10 (diff)
parent6e286e8dc59874db30b6fbb0ca5d32d4a2b5642c (diff)
Merge pull request #1526 from arrbee/cleanup-error-return-without-msg
Make sure error messages are set for most error returns
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/index.c b/src/index.c
index ee659f8ab..53edb4874 100644
--- a/src/index.c
+++ b/src/index.c
@@ -547,8 +547,10 @@ const git_index_entry *git_index_get_bypath(
git_vector_sort(&index->entries);
- if (index_find(&pos, index, path, stage) < 0)
+ if (index_find(&pos, index, path, stage) < 0) {
+ giterr_set(GITERR_INDEX, "Index does not contain %s", path);
return NULL;
+ }
return git_index_get_byindex(index, pos);
}
@@ -830,8 +832,11 @@ int git_index_remove(git_index *index, const char *path, int stage)
git_vector_sort(&index->entries);
- if (index_find(&position, index, path, stage) < 0)
+ if (index_find(&position, index, path, stage) < 0) {
+ giterr_set(GITERR_INDEX, "Index does not contain %s at stage %d",
+ path, stage);
return GIT_ENOTFOUND;
+ }
entry = git_vector_get(&index->entries, position);
if (entry != NULL)