From 93de20b8d282e3747f4d28a6daaa792ce7128cc6 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 1 Jun 2016 14:56:27 -0500 Subject: [PATCH] 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. --- src/index.c | 2 ++ 1 file changed, 2 insertions(+) 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)