summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/diff.c b/src/diff.c
index 633601699..3846a5e1b 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -786,10 +786,15 @@ static int diff_scan_inside_untracked_dir(
/* need to recurse into non-ignored directories */
if (!is_ignored && S_ISDIR(info->nitem->mode)) {
- if ((error = git_iterator_advance_into(
- &info->nitem, info->new_iter)) < 0)
- break;
- continue;
+ error = git_iterator_advance_into(&info->nitem, info->new_iter);
+
+ if (!error)
+ continue;
+ else if (error == GIT_ENOTFOUND) {
+ error = 0;
+ is_ignored = true; /* treat empty as ignored */
+ } else
+ break; /* real error, must stop */
}
/* found a non-ignored item - treat parent dir as untracked */