summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-06-01 14:56:27 -0500
committerCarlos Martín Nieto <cmn@dwim.me>2016-10-01 17:40:36 +0200
commite6a0a8509151326f98fca3e8d18108e937d9168e (patch)
tree04d29b20067ba5c74afd9034fd4899894ddb5adc
parent6c133a75755e14ae014fc75c99fa7a0848d5606e (diff)
downloadlibgit2-e6a0a8509151326f98fca3e8d18108e937d9168e.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)