X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=symlinks.c;h=88601200114f857a57214a9bf0d02ffd39a83504;hb=712d352577012d5035da69bbf49ea0f0df8bb7da;hp=4bdded39c5c5fc491189661bfeca045472970f5b;hpb=3a2dd481e51ed3ea01b84c7db4c661a0a3d5279c;p=git.git diff --git a/symlinks.c b/symlinks.c index 4bdded39c..886012001 100644 --- a/symlinks.c +++ b/symlinks.c @@ -91,6 +91,10 @@ static int lstat_cache(struct cache_def *cache, const char *name, int len, longest_path_match(name, len, cache->path, cache->len, &previous_slash); match_flags = cache->flags & track_flags & (FL_NOENT|FL_SYMLINK); + + if (!(track_flags & FL_FULLPATH) && match_len == len) + match_len = last_slash = previous_slash; + if (match_flags && match_len == cache->len) return match_flags; /* @@ -175,37 +179,6 @@ static int lstat_cache(struct cache_def *cache, const char *name, int len, return ret_flags; } -/* - * Invalidate the given 'name' from the cache, if 'name' matches - * completely with the cache. - */ -void invalidate_lstat_cache(const char *name, int len) -{ - int match_len, previous_slash; - struct cache_def *cache = &default_cache; /* FIXME */ - - match_len = longest_path_match(name, len, cache->path, cache->len, - &previous_slash); - if (len == match_len) { - if ((cache->track_flags & FL_DIR) && previous_slash > 0) { - cache->path[previous_slash] = '\0'; - cache->len = previous_slash; - cache->flags = FL_DIR; - } else { - reset_lstat_cache(cache); - } - } -} - -/* - * Completely clear the contents of the cache - */ -void clear_lstat_cache(void) -{ - struct cache_def *cache = &default_cache; /* FIXME */ - reset_lstat_cache(cache); -} - #define USE_ONLY_LSTAT 0 /*