* Returns 1 if the path is an "other" path with respect to * the index; that is, the path is not mentioned in the index at all, * either as a file, a directory with some files in the index, * or as an unmerged entry. * * We helpfully remove a trailing "/" from directories so that * the output of read_directory can be used as-is. */
| 3440 | * the output of read_directory can be used as-is. |
| 3441 | */ |
| 3442 | int index_name_is_other(struct index_state *istate, const char *name, |
| 3443 | int namelen) |
| 3444 | { |
| 3445 | int pos; |
| 3446 | if (namelen && name[namelen - 1] == '/') |
| 3447 | namelen--; |
| 3448 | pos = index_name_pos(istate, name, namelen); |
| 3449 | if (0 <= pos) |
| 3450 | return 0; /* exact match */ |
| 3451 | pos = -pos - 1; |
| 3452 | if (pos < istate->cache_nr) { |
| 3453 | struct cache_entry *ce = istate->cache[pos]; |
| 3454 | if (ce_namelen(ce) == namelen && |
| 3455 | !memcmp(ce->name, name, namelen)) |
| 3456 | return 0; /* Yup, this one exists unmerged */ |
| 3457 | } |
| 3458 | return 1; |
| 3459 | } |
| 3460 | |
| 3461 | void *read_blob_data_from_index(struct index_state *istate, |
| 3462 | const char *path, unsigned long *size) |
no test coverage detected