Skip to content

Commit bda6eb0

Browse files
Kjetil Barvikgitster
authored andcommitted
lstat_cache(): introduce clear_lstat_cache() function
If you want to completely clear the contents of the lstat_cache(), then call this new function. Signed-off-by: Kjetil Barvik <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeabab5 commit bda6eb0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ extern int has_symlink_leading_path(int len, const char *name);
723723
extern int has_symlink_or_noent_leading_path(int len, const char *name);
724724
extern int has_dirs_only_path(int len, const char *name, int prefix_len);
725725
extern void invalidate_lstat_cache(int len, const char *name);
726+
extern void clear_lstat_cache(void);
726727

727728
extern struct alternate_object_database {
728729
struct alternate_object_database *next;

symlinks.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ void invalidate_lstat_cache(int len, const char *name)
195195
}
196196
}
197197

198+
/*
199+
* Completely clear the contents of the cache
200+
*/
201+
void clear_lstat_cache(void)
202+
{
203+
reset_lstat_cache(0, 0);
204+
}
205+
198206
#define USE_ONLY_LSTAT 0
199207

200208
/*

0 commit comments

Comments
 (0)