@@ -167,12 +167,19 @@ static int match_one(const char *match, const char *name, int namelen)
167
167
}
168
168
169
169
/*
170
- * Given a name and a list of pathspecs, see if the name matches
171
- * any of the pathspecs. The caller is also interested in seeing
172
- * all pathspec matches some names it calls this function with
173
- * (otherwise the user could have mistyped the unmatched pathspec),
174
- * and a mark is left in seen[] array for pathspec element that
175
- * actually matched anything.
170
+ * Given a name and a list of pathspecs, returns the nature of the
171
+ * closest (i.e. most specific) match of the name to any of the
172
+ * pathspecs.
173
+ *
174
+ * The caller typically calls this multiple times with the same
175
+ * pathspec and seen[] array but with different name/namelen
176
+ * (e.g. entries from the index) and is interested in seeing if and
177
+ * how each pathspec matches all the names it calls this function
178
+ * with. A mark is left in the seen[] array for each pathspec element
179
+ * indicating the closest type of match that element achieved, so if
180
+ * seen[n] remains zero after multiple invocations, that means the nth
181
+ * pathspec did not match any names, which could indicate that the
182
+ * user mistyped the nth pathspec.
176
183
*/
177
184
int match_pathspec (const char * * pathspec , const char * name , int namelen ,
178
185
int prefix , char * seen )
@@ -239,12 +246,19 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,
239
246
}
240
247
241
248
/*
242
- * Given a name and a list of pathspecs, see if the name matches
243
- * any of the pathspecs. The caller is also interested in seeing
244
- * all pathspec matches some names it calls this function with
245
- * (otherwise the user could have mistyped the unmatched pathspec),
246
- * and a mark is left in seen[] array for pathspec element that
247
- * actually matched anything.
249
+ * Given a name and a list of pathspecs, returns the nature of the
250
+ * closest (i.e. most specific) match of the name to any of the
251
+ * pathspecs.
252
+ *
253
+ * The caller typically calls this multiple times with the same
254
+ * pathspec and seen[] array but with different name/namelen
255
+ * (e.g. entries from the index) and is interested in seeing if and
256
+ * how each pathspec matches all the names it calls this function
257
+ * with. A mark is left in the seen[] array for each pathspec element
258
+ * indicating the closest type of match that element achieved, so if
259
+ * seen[n] remains zero after multiple invocations, that means the nth
260
+ * pathspec did not match any names, which could indicate that the
261
+ * user mistyped the nth pathspec.
248
262
*/
249
263
int match_pathspec_depth (const struct pathspec * ps ,
250
264
const char * name , int namelen ,
0 commit comments