Re: [PATCH/RFC 2/4] Use 'lstat_cache()' instead of 'has_symlink_leading_path()'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 6, 2009, 08:19 UTC
- Message-ID
- <7vk598j17u.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1231161001-32599-3-git-send-email-barvik@broadpark.no>
Kjetil Barvik <barvik@broadpark.no> writes:
Show 11 quoted lines
> Start using the optimised, faster and more effective symlink/directory > cache. The previously used call: > > has_symlink_leading_path(len, name); > > should be identically with the following call to lstat_cache(): > > lstat_cache(len, name, > LSTAT_SYMLINK|LSTAT_DIR, > LSTAT_SYMLINK); > ...
Care to enlighten why some of callers use the above, but not others? Namely, check_removed() in diff-lib.c and callers in unpack-trees.c care about NOTDIR unlike others, even though the original code checked for exactly the same condition.
Does this mean that some callers of has_symlink_leading_path() checked only for leading symlinks when they should also have checked for a leading non-directory, and this patch is also a bugfix?