diff options
Diffstat (limited to 'src/path.h')
| -rw-r--r-- | src/path.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h index 875c8cb7e..f31cacc70 100644 --- a/src/path.h +++ b/src/path.h @@ -203,6 +203,18 @@ extern bool git_path_contains(git_buf *dir, const char *item); extern bool git_path_contains_dir(git_buf *parent, const char *subdir); /** + * Determine the common directory length between two paths, including + * the final path separator. For example, given paths 'a/b/c/1.txt + * and 'a/b/c/d/2.txt', the common directory is 'a/b/c/', and this + * will return the length of the string 'a/b/c/', which is 6. + * + * @param one The first path + * @param two The second path + * @return The length of the common directory + */ +extern size_t git_path_common_dirlen(const char *one, const char *two); + +/** * Make the path relative to the given parent path. * * @param path The path to make relative |
