summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-06-01 14:56:27 -0500
committerEdward Thomson <ethomson@github.com>2016-06-02 02:36:44 -0500
commit93de20b8d282e3747f4d28a6daaa792ce7128cc6 (patch)
tree517ec3aeb7b6141c49db1cbd44a4c41e140fdf58
parent5baa20b86e23ace3817c4ed38f9de7ea57dcf4a3 (diff)
downloadlibgit2-93de20b8d282e3747f4d28a6daaa792ce7128cc6.tar.gz
index_read_index: reset error correctly
Clear any error state upon each iteration. If one of the iterations ends (with an error of `GIT_ITEROVER`) we need to reset that error to 0, lest we stop the whole process prematurely.
-rw-r--r--src/index.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c
index 31cb27d6c..135bf9ff5 100644
--- a/src/index.c
+++ b/src/index.c
@@ -2968,6 +2968,8 @@ int git_index_read_index(
*remove_entry = NULL;
int diff;
+ error = 0;
+
if (old_entry && new_entry)
diff = git_index_entry_cmp(old_entry, new_entry);
else if (!old_entry && new_entry)