diff: stop processing nitem when its removed When a directory is removed out from underneath us, stop trying to manipulate it.
diff --git a/src/diff.c b/src/diff.c
index a2bfcbf..5b70998 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1091,7 +1091,7 @@ static int handle_unmatched_new_item(
/* if directory is empty, can't advance into it, so either skip
* it or ignore it
*/
- if (contains_oitem)
+ if (error == GIT_ENOTFOUND || contains_oitem)
return iterator_advance(&info->nitem, info->new_iter);
delta_type = GIT_DELTA_IGNORED;
}