Commit 852ded96 by Russell Belfer

Fix bug in diff untracked dir scan

When scanning untracked directories looking for non-ignored files
there was a bug where an empty directory would generate a false
error.
parent 8b2fa181
...@@ -786,10 +786,15 @@ static int diff_scan_inside_untracked_dir( ...@@ -786,10 +786,15 @@ static int diff_scan_inside_untracked_dir(
/* need to recurse into non-ignored directories */ /* need to recurse into non-ignored directories */
if (!is_ignored && S_ISDIR(info->nitem->mode)) { if (!is_ignored && S_ISDIR(info->nitem->mode)) {
if ((error = git_iterator_advance_into( error = git_iterator_advance_into(&info->nitem, info->new_iter);
&info->nitem, info->new_iter)) < 0)
break; if (!error)
continue; 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 */ /* found a non-ignored item - treat parent dir as untracked */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment