summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:11 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:11 -0700
commit92ea1ac8267a14f4eae55f175ac7ff0aeaaddc89 (patch)
tree7bdf4543e8c2428be6f51b8225d3d3a56fbdae36 /read-cache.c
parentffe41f8d3249384b142b28c233e45621f08db2a1 (diff)
parentccad42d4836e2bb4d1843eccd94f58f0189abb1d (diff)
downloadgit-92ea1ac8267a14f4eae55f175ac7ff0aeaaddc89.tar.gz
Merge branch 'rs/refresh-beyond-symlink' into maint
* rs/refresh-beyond-symlink: read-cache: check for leading symlinks when refreshing index
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 5d3c8bd4aa..6f0057fe66 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -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;