| 2366 | } |
| 2367 | |
| 2368 | static int resolve_dtype(int dtype, struct index_state *istate, |
| 2369 | const char *path, int len) |
| 2370 | { |
| 2371 | struct stat st; |
| 2372 | |
| 2373 | if (dtype != DT_UNKNOWN) |
| 2374 | return dtype; |
| 2375 | dtype = get_index_dtype(istate, path, len); |
| 2376 | if (dtype != DT_UNKNOWN) |
| 2377 | return dtype; |
| 2378 | if (lstat(path, &st)) |
| 2379 | return dtype; |
| 2380 | if (S_ISREG(st.st_mode)) |
| 2381 | return DT_REG; |
| 2382 | if (S_ISDIR(st.st_mode)) |
| 2383 | return DT_DIR; |
| 2384 | if (S_ISLNK(st.st_mode)) |
| 2385 | return DT_LNK; |
| 2386 | return dtype; |
| 2387 | } |
| 2388 | |
| 2389 | static enum path_treatment treat_path_fast(struct dir_struct *dir, |
| 2390 | struct cached_dir *cdir, |
no test coverage detected