X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=read-cache.c;h=042b0c2107330c35731a4d42c9907e0b34ad5257;hb=75118b13bc8187c629886b108929f996c47daf01;hp=5b4ab03d27826445a7b02a89de9d5106619e713a;hpb=7b937ca33142ff5ecc655f2be61678a512352122;p=git.git diff --git a/read-cache.c b/read-cache.c index 5b4ab03d..042b0c21 100644 --- a/read-cache.c +++ b/read-cache.c @@ -303,7 +303,8 @@ int cache_match_stat(struct cache_entry *ce, struct stat *st) if (ce->ce_uid != htonl(st->st_uid) || ce->ce_gid != htonl(st->st_gid)) changed |= OWNER_CHANGED; - if (ce->ce_mode != htonl(st->st_mode)) + /* We consider only the owner x bit to be relevant for "mode changes" */ + if (0100 & (ntohl(ce->ce_mode) ^ st->st_mode)) changed |= MODE_CHANGED; if (ce->ce_dev != htonl(st->st_dev) || ce->ce_ino != htonl(st->st_ino)) @@ -368,7 +369,9 @@ static int remove_entry_at(int pos) int remove_file_from_cache(char *path) { int pos = cache_name_pos(path, strlen(path)); - if (pos >= 0) + if (pos < 0) + pos = -pos-1; + while (pos < active_nr && !strcmp(active_cache[pos]->name, path)) remove_entry_at(pos); return 0; }