MCPcopy Create free account
hub / github.com/git/git / common_prefix

Function common_prefix

dir.c:265–270  ·  view source on GitHub ↗

* Returns a copy of the longest leading path common among all * pathspecs. */

Source from the content-addressed store, hash-verified

263 * pathspecs.
264 */
265char *common_prefix(const struct pathspec *pathspec)
266{
267 unsigned long len = common_prefix_len(pathspec);
268
269 return len ? xmemdupz(pathspec->items[0].match, len) : NULL;
270}
271
272int fill_directory(struct dir_struct *dir,
273 struct index_state *istate,

Callers 2

cmd_ls_filesFunction · 0.85
list_pathsFunction · 0.85

Calls 2

common_prefix_lenFunction · 0.85
xmemdupzFunction · 0.85

Tested by

no test coverage detected