treewide: use is_missing_file_error() where ENOENT and ENOTDIR are checked

Using the is_missing_file_error() helper introduced in the previous
step, update all hits from

  $ git grep -e ENOENT --and -e ENOTDIR

There are codepaths that only check ENOENT, and it is possible that
some of them should be checking both.  Updating them is kept out of
this step deliberately, as we do not want to change behaviour in this
step.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2017-05-30 09:23:33 +09:00
parent dc5a18b364
commit c7054209d6
8 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@
static int check_removed(const struct cache_entry *ce, struct stat *st)
{
if (lstat(ce->name, st) < 0) {
if (errno != ENOENT && errno != ENOTDIR)
if (!is_missing_file_error(errno))
return -1;
return 1;
}