Merge branch 'sb/submodule-rm-absorb'
[gitweb.git] / sha1_name.c
index e9ffe685d58366dc3802986519e3e2fd22c151a4..5126853bb5bda5f291039588db96064ffbd1ee5c 100644 (file)
@@ -1408,7 +1408,7 @@ static void diagnose_invalid_sha1_path(const char *prefix,
        if (file_exists(filename))
                die("Path '%s' exists on disk, but not in '%.*s'.",
                    filename, object_name_len, object_name);
-       if (errno == ENOENT || errno == ENOTDIR) {
+       if (is_missing_file_error(errno)) {
                char *fullname = xstrfmt("%s%s", prefix, filename);
 
                if (!get_tree_entry(tree_sha1, fullname,
@@ -1473,7 +1473,7 @@ static void diagnose_invalid_index_path(int stage,
 
        if (file_exists(filename))
                die("Path '%s' exists on disk, but not in the index.", filename);
-       if (errno == ENOENT || errno == ENOTDIR)
+       if (is_missing_file_error(errno))
                die("Path '%s' does not exist (neither on disk nor in the index).",
                    filename);