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:
authorRussell Belfer <rb@github.com>2013-05-01 15:57:24 +0400
committerRussell Belfer <rb@github.com>2013-05-01 15:57:24 +0400
commitae99f5e2ab090c1c666dfbf36753b8c18ab88478 (patch)
treeedd56842db33d05d1c49d07dd69e140b2417fc9b /src/index.c
parentf6f48f9008a9aaba5cbcfc611b616d8ae332b5e3 (diff)
Make sure error messages get set
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 2e2d373b5..3c5173888 100644
--- a/src/index.c
+++ b/src/index.c
@@ -496,8 +496,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);
}
@@ -778,8 +780,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)