| 945 | } |
| 946 | |
| 947 | static int match_dir_prefix(const struct pathspec_item *item, |
| 948 | const char *base, |
| 949 | const char *match, int matchlen) |
| 950 | { |
| 951 | if (basecmp(item, base, match, matchlen)) |
| 952 | return 0; |
| 953 | |
| 954 | /* |
| 955 | * If the base is a subdirectory of a path which |
| 956 | * was specified, all of them are interesting. |
| 957 | */ |
| 958 | if (!matchlen || |
| 959 | base[matchlen] == '/' || |
| 960 | match[matchlen - 1] == '/') |
| 961 | return 1; |
| 962 | |
| 963 | /* Just a random prefix match */ |
| 964 | return 0; |
| 965 | } |
| 966 | |
| 967 | /* |
| 968 | * Perform matching on the leading non-wildcard part of |