Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
read-cache: check for leading symlinks when refreshing index
[gitweb.git]
/
read-cache.c
diff --git
a/read-cache.c
b/read-cache.c
index 4b4effd64b842173d6a06656935436515c755242..5c234cbd70d088b94fd6c19eb6a96d7b852b963d 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-1044,6
+1044,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;