Merge branch 'rs/refresh-beyond-symlink' into maint

* rs/refresh-beyond-symlink:
  read-cache: check for leading symlinks when refreshing index
This commit is contained in:
Junio C Hamano
2014-09-19 14:05:11 -07:00
2 changed files with 51 additions and 0 deletions

View File

@ -1064,6 +1064,14 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
return ce;
}
if (has_symlink_leading_path(ce->name, ce_namelen(ce))) {
if (ignore_missing)
return ce;
if (err)
*err = ENOENT;
return NULL;
}
if (lstat(ce->name, &st) < 0) {
if (ignore_missing && errno == ENOENT)
return ce;