Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93de20b

Browse files
author
Edward Thomson
committed
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.
1 parent 5baa20b commit 93de20b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,6 +2968,8 @@ int git_index_read_index(
29682968
*remove_entry = NULL;
29692969
int diff;
29702970

2971+
error = 0;
2972+
29712973
if (old_entry && new_entry)
29722974
diff = git_index_entry_cmp(old_entry, new_entry);
29732975
else if (!old_entry && new_entry)

0 commit comments

Comments
 (0)