diff options
author | Jeff Hostetler <jeffhostetler@github.com> | 2024-02-26 21:39:17 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-26 15:34:02 -0800 |
commit | 3e4ffda6394082bcb7413b79cdc26fc4f8a52025 (patch) | |
tree | 3f04e8bd6278340fb6416ecf731c36c366caf256 /dir.h | |
parent | 8687c2b067a89e0c91a65b46b4f5eccf041e6718 (diff) | |
download | git-3e4ffda6394082bcb7413b79cdc26fc4f8a52025.tar.gz |
dir: create untracked_cache_invalidate_trimmed_path()
Create a wrapper function for untracked_cache_invalidate_path()
that silently trims a trailing slash, if present, before calling
the wrapped function.
The untracked cache expects to be called with a pathname that
does not contain a trailing slash. This can make it inconvenient
for callers that have a directory path. Lets hide this complexity.
This will be used by a later commit in the FSMonitor code which
may receive directory pathnames from an FSEvent.
Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -576,6 +576,13 @@ int cmp_dir_entry(const void *p1, const void *p2); int check_dir_entry_contains(const struct dir_entry *out, const struct dir_entry *in); void untracked_cache_invalidate_path(struct index_state *, const char *, int safe_path); +/* + * Invalidate the untracked-cache for this path, but first strip + * off a trailing slash, if present. + */ +void untracked_cache_invalidate_trimmed_path(struct index_state *, + const char *path, + int safe_path); void untracked_cache_remove_from_index(struct index_state *, const char *); void untracked_cache_add_to_index(struct index_state *, const char *); |