Commit 6788553231699d4bb8e0ea0c05fdf83407bfaf6f

Edward Thomson 2016-03-17T15:29:21

diff: stop processing nitem when its removed When a directory is removed out from underneath us, stop trying to manipulate it.

1
2
3
4
5
6
7
8
9
10
11
12
13
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;
 		}