Merge branch 'rs/refresh-beyond-symlink'
"git add x" where x that used to be a directory has become a symbolic link to a directory misbehaved. * rs/refresh-beyond-symlink: read-cache: check for leading symlinks when refreshing index
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user